Commit cfd26116 authored by David Johnson's avatar David Johnson

Support the new split domain metadata file format in capnet 920d68c8.

parent 1d2d34ea
Pipeline #1179 skipped
......@@ -426,19 +426,15 @@ class CapnetControllerMetadataManager(object):
'datapath_id':binding['datapath_id'],'binding':binding }
pass
else:
if 'domain_id' in binding:
domain_id = binding['domain_id']
else:
network_id = binding['port']['network_id']
tenant_id = binding['port']['tenant_id']
subnet_id = 'None'
if 'ipallocation' in binding:
subnet_id = binding['ipallocation']['subnet_id']
pass
domain_id = "%s-%s-%s" % (network_id,tenant_id,subnet_id)
network_id = binding['port']['network_id']
tenant_id = binding['port']['tenant_id']
subnet_id = 'None'
if 'ipallocation' in binding:
subnet_id = binding['ipallocation']['subnet_id']
pass
domain_id = "%s-%s" % (network_id,subnet_id)
owner_id = tenant_id
mac = binding['port']['mac_address']
port_id = binding['port_id']
ipaddr = binding['ipallocation']['ip_address']
......@@ -446,8 +442,8 @@ class CapnetControllerMetadataManager(object):
nodename = ipaddr or port_id
# XXX: we currently don't get a mask!
mask = '24'
line = "node %s %s %s %s %s %s %s %s" \
% (str(binding['ofport']),domain_id,role,port_id,nodename,mac,
line = "node %s %s %s %s %s %s %s %s %s" \
% (str(binding['ofport']),domain_id,owner_id,role,port_id,nodename,mac,
ipaddr,mask)
md = { 'role':role,'line':line,'mac':mac,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment