Skip to content

Commit

Permalink
Fix Wildcard entries to return empty data instead of invalid path
Browse files Browse the repository at this point in the history
  • Loading branch information
zbud-msft committed Oct 11, 2024
1 parent 0f5c591 commit 0d65793
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sonic_data_client/db_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,8 @@ func populateDbtablePath(prefix, path *gnmipb.Path, pathG2S *map[*gnmipb.Path][]
switch len(stringSlice) {
case 2: // only table name provided
res, err := redisDb.Keys(tblPath.tableName + "*").Result()
if err != nil || len(res) < 1 {
log.V(2).Infof("Invalid db table Path %v %v", target, dbPath)
return fmt.Errorf("Failed to find %v %v %v %v", target, dbPath, err, res)
if err != nil {
return fmt.Errorf("redis Keys op failed for %v %v, got err %v", target, dbPath, err)
}
tblPath.tableKey = ""
case 3: // Third element could be table key; or field name in which case table name itself is the key too
Expand Down

0 comments on commit 0d65793

Please sign in to comment.