Skip to content

Commit

Permalink
Merge pull request #184 from abdosi/master
Browse files Browse the repository at this point in the history
Use ASICx suffix in DB target path only if the device is multi-asic
  • Loading branch information
rlhui authored Jan 24, 2024
2 parents 07a64ab + 1d7f24c commit 2c862b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sonic_data_client/db_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,14 @@ func IsTargetDb(target string) (string, bool, string, bool) {
dbName := targetname[0]
dbNameSpaceExist := false
dbNamespace, _ := sdcfg.GetDbDefaultNamespace()
isMultiNamespace, _ := sdcfg.CheckDbMultiNamespace()

if len(targetname) > 2 {
log.V(1).Infof("target format is not correct")
return dbName, false, dbNamespace, dbNameSpaceExist
}

if len(targetname) > 1 {
// ASIC Suffix is only used in case if device is multi-asic/namespace
if isMultiNamespace && len(targetname) > 1 {
dbNamespace = targetname[1]
dbNameSpaceExist = true
}
Expand Down

0 comments on commit 2c862b8

Please sign in to comment.