Skip to content

Commit

Permalink
Merge pull request #346 from HewlettPackard/SP_Cleanup
Browse files Browse the repository at this point in the history
Update cleanup function
  • Loading branch information
yuvirani authored Sep 9, 2021
2 parents 868e6a9 + 8c18f11 commit cfc400b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ov/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ func (c *OVClient) CreateProfileFromTemplate(name string, template ServerProfile
new_template.ConnectionSettings = ConnectionSettings{
Connections: template.ConnectionSettings.Connections,
}
cleanup(&new_template)
c.Cleanup(&new_template)
log.Debugf("new_template -> %+v", new_template)
new_template.ServerHardwareURI = blade.URI
new_template.Name = name
Expand All @@ -508,8 +508,11 @@ func (c *OVClient) CreateProfileFromTemplate(name string, template ServerProfile
return err
}

func cleanup(template *ServerProfile) {
template.Bios.ComplianceControl = ""
func (c *OVClient) Cleanup(template *ServerProfile) {
// Bios is a pointer value to struct, handling for creating SP without BIOS settings.
if template.Bios != nil {
template.Bios.ComplianceControl = ""
}
template.Boot.ComplianceControl = ""
template.BootMode.ComplianceControl = ""
template.ConnectionSettings.ComplianceControl = ""
Expand Down

0 comments on commit cfc400b

Please sign in to comment.