cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [2/3] git commit: updated refs/heads/master to 2b0a5ae
Date Thu, 23 Mar 2017 09:48:14 GMT
changed the order fix to be closer to the original code


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

Branch: refs/heads/master
Commit: bb4087733ba0cf94c23ebf29391169993bdc9d57
Parents: 8d4855b
Author: Will Stevens <williamstevens@gmail.com>
Authored: Fri Mar 17 15:07:11 2017 -0400
Committer: Will Stevens <williamstevens@gmail.com>
Committed: Fri Mar 17 15:07:11 2017 -0400

----------------------------------------------------------------------
 systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bb408773/systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py b/systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py
index 8820354..f83bf29 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py
@@ -20,15 +20,14 @@ from netaddr import *
 
 def merge(dbag, ip):
     nic_dev_id = None
-    index = -1 # a non-valid array index
     for dev in dbag:
         if dev == "id":
             continue
-        for i, address in enumerate(dbag[dev]):
+        for address in dbag[dev]:
             if address['public_ip'] == ip['public_ip']:
                 if 'nic_dev_id' in address:
                     nic_dev_id = address['nic_dev_id']
-                index = i
+                dbag[dev].remove(address)
 
     ipo = IPNetwork(ip['public_ip'] + '/' + ip['netmask'])
     if 'nic_dev_id' in ip:
@@ -45,8 +44,8 @@ def merge(dbag, ip):
     if ip['nw_type'] == 'control':
         dbag[ip['device']] = [ip]
     else:
-        if index != -1 and ip['device'] in dbag and index in dbag[ip['device']]:
-            dbag[ip['device']][index] = ip
+        if 'source_nat' in ip and ip['source_nat'] and ip['device'] in dbag and len(dbag[ip['device']])
> 0:
+            dbag[ip['device']].insert(0, ip) # make sure the source_nat ip is first (primary)
on the device
         else:
             dbag.setdefault(ip['device'], []).append(ip)
 


Mime
View raw message