From 8c18f11e7f92b030e7873a421139fdb97007a1f7 Mon Sep 17 00:00:00 2001 From: yuvirani Date: Thu, 9 Sep 2021 16:20:04 +0530 Subject: [PATCH] Update cleanup function --- ov/profiles.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ov/profiles.go b/ov/profiles.go index 709983f1..ea4c74cf 100644 --- a/ov/profiles.go +++ b/ov/profiles.go @@ -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 @@ -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 = ""