cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sw...@apache.org
Subject [02/15] git commit: updated refs/heads/master to e4ba640
Date Tue, 28 Jun 2016 15:28:36 GMT
VR CsConfig: Add is_router(), is_dns(), has_dns(), has_metadata(), use_extdns(), fix get_dns()
with use_extdns()


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/748bf435
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/748bf435
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/748bf435

Branch: refs/heads/master
Commit: 748bf4353052c1a1d30e043253298694cd58526e
Parents: 8753790
Author: Ronald van Zantvoort <ronald@pcextreme.nl>
Authored: Fri May 13 17:23:04 2016 +0200
Committer: Wido den Hollander <wido@widodh.nl>
Committed: Tue Jun 7 13:03:09 2016 +0200

----------------------------------------------------------------------
 .../debian/config/opt/cloud/bin/cs/CsConfig.py  | 32 +++++++++++++-------
 1 file changed, 21 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/748bf435/systemvm/patches/debian/config/opt/cloud/bin/cs/CsConfig.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsConfig.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsConfig.py
index a35a545..f3de977 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsConfig.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsConfig.py
@@ -58,25 +58,35 @@ class CsConfig(object):
         return self.__LOG_LEVEL
 
     def is_vpc(self):
-        return self.cl.get_type() == "vpcrouter"
+        return self.cl.get_type() == 'vpcrouter'
 
     def is_router(self):
-        return self.cl.get_type() == "router"
+        return self.cl.get_type() == 'router'
+
+    def is_dhcp(self):
+        return self.cl.get_type() == 'dhcpsrvr'
+
+    def has_dns(self):
+        return not self.use_extdns()
+
+    def has_metadata(self):
+        return any((self.is_vpc(), self.is_router(), self.is_dhcp()))
 
     def get_domain(self):
         return self.cl.get_domain()
 
+    def use_extdns(self):
+        return self.cmdline().idata().get('useextdns', 'false') == 'true'
+
     def get_dns(self):
+        conf = self.cmdline().idata()
         dns = []
-        if not self.cl.get_use_ext_dns():
-            if not self.is_vpc() and self.cl.is_redundant():
-                dns.append(self.cl.get_guest_gw())
-            else:
-                dns.append(self.address().get_guest_ip())
-        names = ["dns1", "dns2"]
-        for name in names:
-            if name in self.cmdline().idata():
-                dns.append(self.cmdline().idata()[name])
+        if not self.use_extdns():
+            dns.append(self.address().get_guest_ip())
+
+        for name in ('dns1', 'dns2'):
+            if name in conf:
+                dns.append(conf[name])
         return dns
 
     def get_format(self):


Mime
View raw message