"tenant_id": "tenant owning the port"
}
+ def add_dependencies(self, deps):
+ super(Port, self).add_dependencies(deps)
+ # Depend on any Subnet in this template with the same
+ # network_id as this network_id.
+ # It is not known which subnet a port might be assigned
+ # to so all subnets in a network should be created before
+ # the ports in that network.
+ for resource in self.stack.resources.itervalues():
+ if (resource.type() == 'OS::Quantum::Subnet' and
+ resource.properties.get('network_id') ==
+ self.properties.get('network_id')):
+ deps += (self, resource)
+
def handle_create(self):
props = self.prepare_properties(
self.properties,
}]
}
},
+ "port2": {
+ "Type": "OS::Quantum::Port",
+ "Properties": {
+ "name": "port2",
+ "network_id": { "Ref" : "network" }
+ }
+ },
"router": {
"Type": "OS::Quantum::Router"
},
self.assertEqual('91e47a57-7508-46fe-afc9-fc454e8580e1',
rsrc.FnGetAtt('id'))
+ # assert the dependency (implicit or explicit) between the ports
+ # and the subnet
+ self.assertIn(stack['port'], stack.dependencies[stack['subnet']])
+ self.assertIn(stack['port2'], stack.dependencies[stack['subnet']])
+
self.assertRaises(resource.UpdateReplace,
rsrc.handle_update, {}, {}, {})