diff --git a/heat/engine/resources/neutron/net.py b/heat/engine/resources/neutron/net.py index acbcd4818aa..a233d79b0af 100644 --- a/heat/engine/resources/neutron/net.py +++ b/heat/engine/resources/neutron/net.py @@ -29,7 +29,8 @@ class Net(neutron.NeutronResource): 'value_specs': {'Type': 'Map', 'Default': {}}, 'admin_state_up': {'Default': True, - 'Type': 'Boolean'}} + 'Type': 'Boolean'}, + 'tenant_id': {'Type': 'String'}} attributes_schema = { "id": "the unique identifier for this network", "status": "the status of the network", diff --git a/heat/engine/resources/neutron/subnet.py b/heat/engine/resources/neutron/subnet.py index d317fad8724..e6a9aab17b6 100644 --- a/heat/engine/resources/neutron/subnet.py +++ b/heat/engine/resources/neutron/subnet.py @@ -48,7 +48,8 @@ class Subnet(neutron.NeutronResource): 'Schema': { 'Type': 'Map', 'Schema': allocation_schema - }}} + }}, + 'tenant_id': {'Type': 'String'}} attributes_schema = { "name": "friendly name of the subnet", "network_id": "parent network of the subnet", diff --git a/heat/tests/test_neutron.py b/heat/tests/test_neutron.py index c90d3e2689e..fd782c79c48 100644 --- a/heat/tests/test_neutron.py +++ b/heat/tests/test_neutron.py @@ -43,7 +43,8 @@ "network": { "Type": "OS::Neutron::Net", "Properties": { - "name": "the_network" + "name": "the_network", + "tenant_id": "c1210485b2424d48804aad5d39c61b8f" } }, "unnamed_network": { @@ -59,6 +60,7 @@ "Type": "OS::Neutron::Subnet", "Properties": { "network_id": { "Ref" : "network" }, + "tenant_id": "c1210485b2424d48804aad5d39c61b8f", "ip_version": 4, "cidr": "10.0.3.0/24", "allocation_pools": [{"start": "10.0.3.20", "end": "10.0.3.150"}], @@ -225,7 +227,10 @@ def test_net(self): clients.OpenStackClients.keystone().AndReturn( fakes.FakeKeystoneClient()) neutronclient.Client.create_network({ - 'network': {'name': u'the_network', 'admin_state_up': True} + 'network': { + 'name': u'the_network', + 'admin_state_up': True, + 'tenant_id': 'c1210485b2424d48804aad5d39c61b8f'} }).AndReturn({"network": { "status": "BUILD", "subnets": [], @@ -368,7 +373,8 @@ def test_subnet(self): 'allocation_pools': [ {'start': u'10.0.3.20', 'end': u'10.0.3.150'}], 'ip_version': 4, - 'cidr': u'10.0.3.0/24' + 'cidr': u'10.0.3.0/24', + 'tenant_id': 'c1210485b2424d48804aad5d39c61b8f' } }).AndReturn({ "subnet": { @@ -465,7 +471,8 @@ def test_subnet_disable_dhcp(self): {'start': u'10.0.3.20', 'end': u'10.0.3.150'}], 'ip_version': 4, 'enable_dhcp': False, - 'cidr': u'10.0.3.0/24' + 'cidr': u'10.0.3.0/24', + 'tenant_id': 'c1210485b2424d48804aad5d39c61b8f' } }).AndReturn({ "subnet": {