Skip to content

Commit

Permalink
Add tenant_id property to neutron Net and Subnet
Browse files Browse the repository at this point in the history
tenant_id has been added since this resource was written.

Change-Id: Ieb73df85f11e79e24755d2830927cde246651b38
Closes-Bug: #1227287
  • Loading branch information
steveb committed Sep 23, 2013
1 parent b21ce20 commit 9b28f22
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
3 changes: 2 additions & 1 deletion heat/engine/resources/neutron/net.py
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion heat/engine/resources/neutron/subnet.py
Expand Up @@ -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",
Expand Down
15 changes: 11 additions & 4 deletions heat/tests/test_neutron.py
Expand Up @@ -43,7 +43,8 @@
"network": {
"Type": "OS::Neutron::Net",
"Properties": {
"name": "the_network"
"name": "the_network",
"tenant_id": "c1210485b2424d48804aad5d39c61b8f"
}
},
"unnamed_network": {
Expand All @@ -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"}],
Expand Down Expand Up @@ -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": [],
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down

0 comments on commit 9b28f22

Please sign in to comment.