[node-patches] Change in ovirt-node[master]: setup: Allow only second NTP server

fabiand at fedoraproject.org fabiand at fedoraproject.org
Thu Sep 27 14:10:25 UTC 2012


Fabian Deutsch has uploaded a new change for review.

Change subject: setup: Allow only second NTP server
......................................................................

setup: Allow only second NTP server

Previously an exception was raised if only the second NTP server was
given and the first was left blank. This patch handles this case
correctly.

rhbz#860534

Change-Id: I974e4b7ae91859c8c7fd5e8c2871e949a949d694
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/ovirt-config-setup.py
1 file changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/47/8247/1

diff --git a/scripts/ovirt-config-setup.py b/scripts/ovirt-config-setup.py
index c9e6e67..f7798a0 100755
--- a/scripts/ovirt-config-setup.py
+++ b/scripts/ovirt-config-setup.py
@@ -1482,19 +1482,20 @@
     def process_network_config(self):
         # First update the central "model" (defaults/ovirt)
         dns_servers = ""
-        ntp_servers = ""
+        ntp_servers = []
         if not self.dns_host1.value() == "":
             dns_servers += self.dns_host1.value()
         if not self.dns_host2.value() == "":
             dns_servers += "," + self.dns_host2.value()
         if not self.ntp_host1.value() == "":
-            ntp_servers += self.ntp_host1.value()
+            ntp_servers.append(self.ntp_host1.value())
         if not self.ntp_host2.value() == "":
-            ntp_servers += "," + self.ntp_host2.value()
+            ntp_servers.append(self.ntp_host2.value())
         if not dns_servers == "":
             augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_DNS",
                     '"' + dns_servers + '"')
-        if not ntp_servers == "":
+        if len(ntp_servers) > 0:
+            ntp_servers = ",".join(ntp_servers)
             augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_NTP",
                     '"' + ntp_servers + '"')
         aug.load()


--
To view, visit http://gerrit.ovirt.org/8247
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I974e4b7ae91859c8c7fd5e8c2871e949a949d694
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list