]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Add tenant_id property to neutron Net and Subnet
authorSteve Baker <sbaker@redhat.com>
Wed, 18 Sep 2013 18:28:11 +0000 (11:28 -0700)
committerSteve Baker <sbaker@redhat.com>
Mon, 23 Sep 2013 02:09:34 +0000 (14:09 +1200)
tenant_id has been added since this resource was written.

Change-Id: Ieb73df85f11e79e24755d2830927cde246651b38
Closes-Bug: #1227287

heat/engine/resources/neutron/net.py
heat/engine/resources/neutron/subnet.py
heat/tests/test_neutron.py

index acbcd4818aa0d143de19f757678b26f95390fa3e..a233d79b0affceefdd0cd3f105b27a25ed477b0e 100644 (file)
@@ -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",
index d317fad8724330e40e1d104dac2cc25f5ecbb419..e6a9aab17b6c9413f406ee36509ca47b16bbecd3 100644 (file)
@@ -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",
index c90d3e2689e390cea4422793473525a89bde4393..fd782c79c48d0ae85d0f74b0f2cae1fbc08c0212 100644 (file)
@@ -43,7 +43,8 @@ neutron_template = '''
     "network": {
       "Type": "OS::Neutron::Net",
       "Properties": {
-        "name": "the_network"
+        "name": "the_network",
+        "tenant_id": "c1210485b2424d48804aad5d39c61b8f"
       }
     },
     "unnamed_network": {
@@ -59,6 +60,7 @@ neutron_template = '''
       "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 @@ class NeutronNetTest(HeatTestCase):
         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 @@ class NeutronSubnetTest(HeatTestCase):
                 '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 @@ class NeutronSubnetTest(HeatTestCase):
                     {'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": {