From 8d80efec642d2a8fef31e6c46b4eefe784e5ffec Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 10 Jan 2022 09:29:40 -0500 Subject: [PATCH 1/2] Correct configbmc misidentification of lan chan The lan channel get mac address was incorrect, change to correctly request. --- confluent_osdeploy/el7/profiles/default/scripts/configbmc | 2 +- confluent_osdeploy/el8/profiles/default/scripts/configbmc | 2 +- confluent_osdeploy/genesis/profiles/default/scripts/configbmc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/confluent_osdeploy/el7/profiles/default/scripts/configbmc b/confluent_osdeploy/el7/profiles/default/scripts/configbmc index 7176c12c..4fdfc727 100644 --- a/confluent_osdeploy/el7/profiles/default/scripts/configbmc +++ b/confluent_osdeploy/el7/profiles/default/scripts/configbmc @@ -267,7 +267,7 @@ def get_lan_channel(s): medtype = int(rsp[1]) & 0b1111111 if medtype not in (4, 6): continue - rsp = s.raw_command(0xc, 2, bytearray([2, chan, 5, 0, 0])) + rsp = s.raw_command(0xc, 2, bytearray([chan, 5, 0, 0])) if rsp.get('code', 1) == 0: return chan return 1 diff --git a/confluent_osdeploy/el8/profiles/default/scripts/configbmc b/confluent_osdeploy/el8/profiles/default/scripts/configbmc index 7176c12c..4fdfc727 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/configbmc +++ b/confluent_osdeploy/el8/profiles/default/scripts/configbmc @@ -267,7 +267,7 @@ def get_lan_channel(s): medtype = int(rsp[1]) & 0b1111111 if medtype not in (4, 6): continue - rsp = s.raw_command(0xc, 2, bytearray([2, chan, 5, 0, 0])) + rsp = s.raw_command(0xc, 2, bytearray([chan, 5, 0, 0])) if rsp.get('code', 1) == 0: return chan return 1 diff --git a/confluent_osdeploy/genesis/profiles/default/scripts/configbmc b/confluent_osdeploy/genesis/profiles/default/scripts/configbmc index fb1d61f4..d50727da 100644 --- a/confluent_osdeploy/genesis/profiles/default/scripts/configbmc +++ b/confluent_osdeploy/genesis/profiles/default/scripts/configbmc @@ -275,7 +275,7 @@ def get_lan_channel(s): medtype = int(rsp[1]) & 0b1111111 if medtype not in (4, 6): continue - rsp = s.raw_command(0xc, 2, bytearray([2, chan, 5, 0, 0])) + rsp = s.raw_command(0xc, 2, bytearray([chan, 5, 0, 0])) if rsp.get('code', 1) == 0: return chan return 1 From 0186f002e09ba019212fa5f7d966cfbc5dabbf5f Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 10 Jan 2022 12:01:15 -0500 Subject: [PATCH 2/2] Have configbmc stall on TSM TSM will stall out for an extended period of time after a network change. Accomodate by forcing a pause on detection of TSM. --- .../genesis/profiles/default/scripts/configbmc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/confluent_osdeploy/genesis/profiles/default/scripts/configbmc b/confluent_osdeploy/genesis/profiles/default/scripts/configbmc index d50727da..4062b7af 100644 --- a/confluent_osdeploy/genesis/profiles/default/scripts/configbmc +++ b/confluent_osdeploy/genesis/profiles/default/scripts/configbmc @@ -165,9 +165,18 @@ def set_port(s, port, vendor, model): return 1 -def get_remote_config_mod(vendor, model): +def get_remote_config_mod(vendor, model, waiters): if vendor in ('IBM', 'Lenovo'): if _is_tsm(model): + for waiter in waiters: + if waiter: + sys.stdout.write('Waiting for TSM network to activate') + for x in range(0, 90): + sys.stdout.write('.') + sys.stdout.flush() + time.sleep(1) + sys.stdout.write('Complete\n') + break return 'tsm' else: return 'xcc' @@ -415,7 +424,7 @@ def main(): dotwait() sys.stdout.write('done\n') sys.stdout.flush() - cfgmod = get_remote_config_mod(vendor, model) + cfgmod = get_remote_config_mod(vendor, model, (awaitip, awaitvlan, awaitprefix, awaitgw)) if cfgmod: with open('configbmc.configmod', 'w+') as cm: cm.write('configmod: {0}\n'.format(cfgmod))