Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmayja committed Nov 18, 2024
1 parent 7f2737c commit 01bfbbb
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions info/as_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,23 +409,19 @@ func ParseNamespaceNames(m map[string]string) []string {

// ParseDCNames parses all DC names
func ParseDCNames(m map[string]string) []string {
rawXDRConfig := m[cmdConfigXDR]
xdrConfig := ParseIntoMap(rawXDRConfig, ";", "=")
rawNames, ok := xdrConfig[constStatDCNames].(string)
rawXDRConfig, exists := m[cmdConfigXDR]
if !exists || rawXDRConfig == "" {
return []string{}
}

var dcNames []string
xdrConfig := ParseIntoMap(rawXDRConfig, ";", "=")

if ok {
if rawNames == "" {
dcNames = []string{}
} else {
dcNames = strings.Split(rawNames, ",")
}
} else {
dcNames = []string{}
rawNames, ok := xdrConfig[constStatDCNames].(string)
if !ok || rawNames == "" {
return []string{}
}

return dcNames
return strings.Split(rawNames, ",")
}

// ParseTLSNames parses all TLS names
Expand Down

0 comments on commit 01bfbbb

Please sign in to comment.