mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Added cs_ip module
Corrected syntax error in merge.py
This commit is contained in:
parent
a357e12943
commit
018b56385c
27
systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py
Normal file
27
systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py
Normal file
@ -0,0 +1,27 @@
|
||||
from pprint import pprint
|
||||
#[{u'accountId': 2,
|
||||
#u'add': True,
|
||||
#u'broadcastUri': u'vlan://untagged',
|
||||
#u'firstIP': False,
|
||||
#u'networkRate': 200,
|
||||
#u'newNic': False,
|
||||
#u'nicDevId': 1,
|
||||
#u'oneToOneNat': False,
|
||||
#u'publicIp': u'10.0.2.102',
|
||||
#u'sourceNat': True,
|
||||
#u'trafficType': u'Public',
|
||||
#u'vifMacAddress': u'06:f6:5e:00:00:03',
|
||||
#u'vlanGateway': u'10.0.2.1',
|
||||
#u'vlanNetmask': u'255.255.255.0'}]
|
||||
|
||||
def merge(dbag, ip):
|
||||
added = False
|
||||
for mac in dbag:
|
||||
if mac == "id":
|
||||
continue
|
||||
for address in dbag[mac]:
|
||||
if address['publicIp'] == ip['publicIp']:
|
||||
dbag[mac].remove(address)
|
||||
if ip['add']:
|
||||
dbag.setdefault('eth' + str(ip['nicDevId']), []).append( ip )
|
||||
return dbag
|
||||
@ -76,7 +76,7 @@ class updateDataBag:
|
||||
dp['sourceNat'] = False
|
||||
dp['add'] = True
|
||||
dp['oneToOneNat'] = False
|
||||
dp['vlanGateway'] = ??
|
||||
#dp['vlanGateway'] = ??
|
||||
dp['nicDevId'] = num
|
||||
return
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user