2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 09:13:08 +00:00

Merge pull request #5007 from gurevichmark/openbmc_rspconfig_ntpservers

Display a warning when setting NTP Server
This commit is contained in:
Victor Hu 2018-03-26 15:23:20 -04:00 committed by GitHub
commit a9ce890a6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -345,6 +345,10 @@ rmdir \"/tmp/$userid\" \n")
if nic in netinfo:
ntpservers = netinfo[nic]['ntpservers']
self.callback.info('%s: BMC NTP Servers: %s' % (node, ntpservers))
if ntpservers != None:
# Display a warning if the host in not powered off
# Time on the BMC is not synced while the host is powered on
self.callback.info('%s: Warning: time will not be synchronized until the host is powered off.' % node)
def _get_facing_nic(self, bmcip, netinfo):
for k,v in netinfo.items():

View File

@ -3383,6 +3383,7 @@ sub rspconfig_response {
my @gateway = ();
my @vlan = ();
my @ntpservers = ();
my $real_ntp_server = 0;
my @nics = keys %nicinfo;
foreach my $nic (@nics) {
my $addon_info = '';
@ -3392,6 +3393,7 @@ sub rspconfig_response {
if ($nicinfo{$nic}{ntpservers}) {
push @ntpservers, "BMC NTP Servers$addon_info: $nicinfo{$nic}{ntpservers}";
$real_ntp_server = 1;
} else {
push @ntpservers, "BMC NTP Servers$addon_info: None";
}
@ -3414,6 +3416,11 @@ sub rspconfig_response {
push @output, "BMC Hostname: $hostname";
} elsif ($opt eq "ntpservers") {
push @output, @ntpservers;
if (($real_ntp_server) && ($status_info{RSPCONFIG_SET_RESPONSE}{argv} =~ "NTPServers")) {
# Display a warning if the host in not powered off
# Time on the BMC is not synced while the host is powered on.
push @output, "Warning: time will not be synchronized until the host is powered off.";
}
}
if ($multiple_error and ($opt =~ /^ip$|^ipsrc$|^netmask$|^gateway$|^vlan$/)) {