Neutron v2 base.py auto populates a 'tenant_id' attribute on
calls if the attribute is not passed. This causes a POST
to create a flavor service binding to fail when verifying
attributes with:
Unrecognized attribute(s) 'tenant_id'
Solution is to add tenant_id as expected attribute in the
attribute map as done in other sub resources like QOS.
Fix unit test for non-keystone case.
Change-Id: Ic2bd1271f297fc10b49304ffd5fe617637e3d8f4
Closes-Bug:
1489197
'member_name': 'flavor'},
'parameters': {'id': {'allow_post': True, 'allow_put': False,
'validate': {'type:uuid': None},
- 'is_visible': True}}
+ 'is_visible': True},
+ 'tenant_id': {'allow_post': True, 'allow_put': False,
+ 'required_by_policy': True,
+ 'validate': {'type:string':
+ attr.TENANT_ID_MAX_LEN},
+ 'is_visible': True}}
}
}
self.assertEqual(expected, res)
def test_associate_service_profile_with_flavor(self):
- expected = {'service_profile': {'id': _uuid()}}
+ tenant_id = uuidutils.generate_uuid()
+ expected = {'service_profile': {'id': _uuid(),
+ 'tenant_id': tenant_id}}
instance = self.plugin.return_value
instance.create_flavor_service_profile.return_value = (
expected['service_profile'])