You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sw...@apache.org on 2016/06/28 15:28:37 UTC

[03/15] git commit: updated refs/heads/master to e4ba640

VR CsGuestNetwork obey useextdns


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

Branch: refs/heads/master
Commit: 2790d7a69b5cb66b6bbc8cd68b712d020a07f063
Parents: ed820be
Author: Ronald van Zantvoort <ro...@pcextreme.nl>
Authored: Fri May 13 17:18:01 2016 +0200
Committer: Wido den Hollander <wi...@widodh.nl>
Committed: Tue Jun 7 13:03:09 2016 +0200

----------------------------------------------------------------------
 .../config/opt/cloud/bin/cs/CsGuestNetwork.py       | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2790d7a6/systemvm/patches/debian/config/opt/cloud/bin/cs/CsGuestNetwork.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsGuestNetwork.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsGuestNetwork.py
index e1afb92..d23a870 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsGuestNetwork.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsGuestNetwork.py
@@ -38,13 +38,15 @@ class CsGuestNetwork:
     def get_dns(self):
         if not self.guest:
             return self.config.get_dns()
-        # Can a router provide dhcp but not dns?
-        if 'dns' in self.data and 'router_guest_gateway' in self.data:
-            return [self.data['router_guest_gateway']] + self.data['dns'].split(',')
-        elif "router_guest_gateway" in self.data:
-            return [self.data['router_guest_gateway']]
-        else:
-            return [""]
+
+        dns = []
+        if not self.config.use_extdns() and 'router_guest_gateway' in self.data:
+            dns.append(self.data['router_guest_gateway'])
+
+        if 'dns' in self.data:
+            dns.extend(self.data['dns'].split(','))
+
+        return dns or ['']
 
     def set_dns(self, val):
         self.data['dns'] = val