[node-patches] Change in ovirt-node[master]: setup: Allow removal of DNS/NTP servers

fabiand at fedoraproject.org fabiand at fedoraproject.org
Thu Oct 25 14:25:39 UTC 2012


Fabian Deutsch has uploaded a new change for review.

Change subject: setup: Allow removal of DNS/NTP servers
......................................................................

setup: Allow removal of DNS/NTP servers

Previously at least one DNS/NTP had to be given, thi shad the effect
that neither all DNS or NTP servers could be removed.

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


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/26/8826/1

diff --git a/scripts/ovirt-config-setup.py b/scripts/ovirt-config-setup.py
index 1180bf2..cae933a 100755
--- a/scripts/ovirt-config-setup.py
+++ b/scripts/ovirt-config-setup.py
@@ -1498,14 +1498,16 @@
             ntp_servers.append(self.ntp_host1.value())
         if not self.ntp_host2.value() == "":
             ntp_servers.append(self.ntp_host2.value())
-        if len(dns_servers) > 0:
-            dns_servers = ",".join(dns_servers)
-            augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_DNS",
-                    '"' + dns_servers + '"')
-        if len(ntp_servers) > 0:
-            ntp_servers = ",".join(ntp_servers)
-            augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_NTP",
-                    '"' + ntp_servers + '"')
+
+        # Prepare DNS server string, empty string if no servers
+        dns_servers = ",".join(dns_servers)
+        augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_DNS",
+                '"' + dns_servers + '"')
+
+        # Prepare NTP server string, empty string if no servers
+        ntp_servers = ",".join(ntp_servers)
+        augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_NTP",
+                '"' + ntp_servers + '"')
         aug.load()
 
         # Then apply the configuration


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb47e3491e3b0fd2b6f40558153bf12b168de235
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