Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions 9 systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@

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:
Expand All @@ -45,8 +44,8 @@ def merge(dbag, ip):
if ip['nw_type'] == 'control':
dbag[ip['device']] = [ip]
else:
if index != -1:
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)

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.