From d16be880e4cfdf6ab3a4b9b5de65b1428e0f618f Mon Sep 17 00:00:00 2001 From: xuweibj Date: Mon, 27 Aug 2018 03:35:48 -0400 Subject: [PATCH] fix issue 5548, if ip source is dhcp will remind that could not set ntpservers --- .../lib/python/agent/hwctl/executor/openbmc_bmcconfig.py | 3 +++ xCAT-server/lib/xcat/plugins/openbmc.pm | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py index fa1377626..b5746eeff 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py @@ -334,6 +334,9 @@ rmdir \"/tmp/$userid\" \n") if not nic: return self.callback.error('Can not get facing NIC for %s' % bmcip, node) + if (netinfo[nic]['ipsrc'] == 'DHCP'): + return self.callback.error('BMC IP source is DHCP, could not set NTPServers', node) + try: obmc.set_ntp_servers(nic, servers) self.callback.info('%s: BMC Setting NTPServers...' % node) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 10b11257c..a01f4527d 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -3532,6 +3532,11 @@ sub rspconfig_response { if (defined($content{Address}) and $content{Address}) { if ($content{Address} eq $node_info{$node}{bmcip} and $node_info{$node}{cur_status} eq "RSPCONFIG_GET_NIC_RESPONSE") { $status_info{RSPCONFIG_SET_NTPSERVERS_REQUEST}{init_url} =~ s/#NIC#/$nic/g; + if (defined($content{Origin}) and $content{Origin} =~ /DHCP$/) { + xCAT::SvrUtils::sendmsg([1, "BMC IP source is DHCP, could not set NTPServers"], $callback, $node); + $wait_node_num--; + return; + } if ($next_status{"RSPCONFIG_GET_NIC_RESPONSE"}) { $node_info{$node}{cur_status} = $next_status{"RSPCONFIG_GET_NIC_RESPONSE"}; gen_send_request($node);