Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions dataapi/estb_firmware_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,12 @@ func AddEstbFirmwareContext(ws *xhttp.XconfServer, r *http.Request, contextMap m
}
}
} else if Xc.EnableAccountDataService {
if util.IsValidMacAddress(contextMap[common.ESTB_MAC_ADDRESS]) || util.IsValidMacAddress(contextMap[common.ECM_MAC_ADDRESS]) {
xAccountId, err := ws.GroupServiceConnector.GetAccountIdData(contextMap[common.ECM_MAC_ADDRESS], fields)
ecmMacValue := contextMap[common.ECM_MAC]
if ecmMacValue == "" {
ecmMacValue = contextMap[common.ECM_MAC_PARAM]
}
if util.IsValidMacAddress(contextMap[common.ESTB_MAC]) || util.IsValidMacAddress(ecmMacValue) {
xAccountId, err := ws.GroupServiceConnector.GetAccountIdData(ecmMacValue, fields)
if err != nil {
log.WithFields(log.Fields{"error": err}).Error("Error getting AccountService information")
}
Expand All @@ -248,15 +252,20 @@ func AddEstbFirmwareContext(ws *xhttp.XconfServer, r *http.Request, contextMap m
if err != nil {
log.WithFields(log.Fields{"error": err}).Error("Error getting AccountService information")
} else {
if partner, ok := accountProducts["Partner"]; ok && partner != "" {
contextMap[common.PARTNER_ID] = partner
if len(accountProducts) == 0 {
log.WithFields(fields).Warn("Empty or nil response from ADA keyspace")
} else {
// Successfully retrieved, update context
if partner, ok := accountProducts["Partner"]; ok && partner != "" {
contextMap[common.PARTNER_ID] = partner
}
}
}
}
}
} else {
//err both the service
log.WithFields(log.Fields{"error": err}).Error("Both the Account Service calls have been disabled")
log.Error("Both the Account Service calls have been disabled")
}
AddContextFromTaggingService(ws, contextMap, satToken, "", false, fields)
AddGroupServiceFTContext(Ws, common.ESTB_MAC, contextMap, true, fields)
Expand Down