Douglas Schilling Landgraf has posted comments on this change. Change subject: ntp: include peerntp_no karg ......................................................................
Patch Set 2: (5 comments) https://gerrit.ovirt.org/#/c/40406/2/scripts/ovirt-init-functions.sh.in File scripts/ovirt-init-functions.sh.in: Line 783: ;; Line 784: keyboard*) Line 785: keyboard_layout=${i#keyboard=} Line 786: ;; Line 787: peerntp_no*) > Please use a argument like peerntp=no, instead of a flag peerntp_no that fi Done Line 788: # If user provided in karg peerntp_no we will: Line 789: # 1 - Update /etc/sysconfig/network with PEERNTP=no to stop Line 790: # dhclient script updating ntp.conf Line 791: # 2 - Commend any previous ntp server in ntp.conf https://gerrit.ovirt.org/#/c/40406/2/src/ovirt/node/config/defaults.py File src/ovirt/node/config/defaults.py: Line 430: # peerntp_no karg and do not include in any Line 431: # ifcfg file the PEERNTP=yes. This will avoid Line 432: # any update in ntp.conf by the nic interfaces Line 433: aug = utils.AugeasWrapper() Line 434: sys_network = aug.get("/files/etc/sysconfig/network/PEERNTP") > Once the function I mention below is created, you can use it here as well. Done Line 435: if sys_network and "no" in sys_network: Line 436: cfg.peerntp = "no" Line 437: else: Line 438: cfg.peerntp = "yes" Line 431: # ifcfg file the PEERNTP=yes. This will avoid Line 432: # any update in ntp.conf by the nic interfaces Line 433: aug = utils.AugeasWrapper() Line 434: sys_network = aug.get("/files/etc/sysconfig/network/PEERNTP") Line 435: if sys_network and "no" in sys_network: > The function for the global ntp setting should return a boolean, then there Done Line 436: cfg.peerntp = "no" Line 437: else: Line 438: cfg.peerntp = "yes" Line 439: Line 925: """ Line 926: NETWORK_SCRIPTS = "/etc/sysconfig/network-scripts/" Line 927: NETWORK_FILE = "/files/etc/sysconfig/network/PEERNTP" Line 928: Line 929: aug = utils.AugeasWrapper() > This is one function (ovirt.node.config.network.peerntp()) Done Line 930: if aug.get(NETWORK_FILE): Line 931: aug.set(NETWORK_FILE, option) Line 932: Line 933: for name in os.listdir(NETWORK_SCRIPTS): https://gerrit.ovirt.org/#/c/40406/2/src/ovirt/node/setup/core/network_page.py File src/ovirt/node/setup/core/network_page.py: Line 379: self.logger.info("Setting new timeservers: %s" % timeservers) Line 380: timesrv = defaults.Timeservers() Line 381: Line 382: # Validate if user removed both NTP entries in TUI Line 383: if not timeservers[0] and not timeservers[1]: > What about doing: Probably you are speaking about len(timeservers[0]) > 0. If we use len(timeservers) will always return 2 as the fields are filled with ''. Line 384: timesrv.set_peerntp("no") Line 385: else: Line 386: timesrv.set_peerntp("yes") Line 387: -- To view, visit https://gerrit.ovirt.org/40406 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I127a78df38c21899f37fab2a55aea415f256540a Gerrit-PatchSet: 2 Gerrit-Project: ovirt-node Gerrit-Branch: master Gerrit-Owner: Douglas Schilling Landgraf <[email protected]> Gerrit-Reviewer: Douglas Schilling Landgraf <[email protected]> Gerrit-Reviewer: Fabian Deutsch <[email protected]> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: [email protected] Gerrit-HasComments: Yes _______________________________________________ node-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/node-patches
