diff --git a/confluent_osdeploy/el8/profiles/default/scripts/configbmc b/confluent_osdeploy/el8/profiles/default/scripts/configbmc index 8e4fe070..7176c12c 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/configbmc +++ b/confluent_osdeploy/el8/profiles/default/scripts/configbmc @@ -111,6 +111,14 @@ class Session(object): self.databuffer.raw[1:self.rsp.msg.data_len])} return response + def await_config(s, bmccfg, channel): + vlan = bmccfg.get('bmcvlan', None) + ipv4 = bmccfg.get('bmcipv4', None) + prefix = bmccfg.get('prefixv4', None) + gw = bmccfg.get('bmcgw', None) + + + def raw_command(self, netfn, command, @@ -217,8 +225,7 @@ def set_port_xcc(s, port, model): sys.stdout.write('Complete\n') -def set_vlan(s, vlan, channel): - ovlan = vlan +def check_vlan(s, vlan, channel): if vlan == 'off': vlan = b'\x00\x00' else: @@ -229,7 +236,19 @@ def set_vlan(s, vlan, channel): currvlan = bytes(s.raw_command(0xc, 2, bytearray([channel, 0x14 ,0, 0]))['data'][1:]) if bytearray(currvlan)[1] & 0b10000000 == 0: currvlan = b'\x00\x00' - if currvlan == vlan: + return currvlan == vlan + + +def set_vlan(s, vlan, channel): + ovlan = vlan + if vlan == 'off': + vlan = b'\x00\x00' + else: + vlan = int(vlan) + if vlan: + vlan = vlan | 32768 + vlan = struct.pack('