Skip to content

Commit

Permalink
Extra LDAP groups for chassis as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
oothman committed Aug 3, 2021
1 parent 966c267 commit 5da4820
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
12 changes: 12 additions & 0 deletions pkg/butler/configure/chassis.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@ func (b *Cmc) Apply() { //nolint: gocyclo
}
case "ldap_group":
if b.config.LdapGroups != nil && b.config.Ldap != nil {
k, err := b.config.LdapGroups.GetExtraGroups(b.asset.Serial, b.asset.Vendor)
if err != nil {
b.logger.WithFields(logrus.Fields{
"Vendor": b.vendor,
"Model": b.model,
"Serial": b.serial,
"IPAddress": b.ip,
"Error": err,
"K": k,
"Groups": b.config.LdapGroups.Groups,
}).Warn("Trying to fetch more LDAP groups has failed.")
}
err = b.configure.LdapGroups(b.config.LdapGroups.Groups, b.config.Ldap)
}
case "license":
Expand Down
10 changes: 6 additions & 4 deletions pkg/butler/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,25 @@ func (b *Butler) executeCommand(command string, asset *asset.Asset) (err error)
log.WithFields(logrus.Fields{
"component": component,
"Serial": asset.Serial,
"AssetType": asset.Type,
"Asset Type": asset.Type,
"Vendor": asset.Vendor, //at this point the vendor may or may not be known.
"Location": asset.Location,
"IP Address": asset.IPAddress,
"Command": command,
"Command successful": success,
"Command Successful": success,
"Error": err,
"Output": output,
}).Warn("Command execute returned error.")
} else {
log.WithFields(logrus.Fields{
"component": component,
"Serial": asset.Serial,
"AssetType": asset.Type,
"Asset Type": asset.Type,
"Vendor": asset.Vendor,
"Location": asset.Location,
"IP Address": asset.IPAddress,
"Command": command,
"Command successful": success,
"Command Successful": success,
"Output": output,
}).Debug("Command successfully executed.")
}
Expand Down

0 comments on commit 5da4820

Please sign in to comment.