Merge "Neutron server was not compatible with member actions"
This commit is contained in:
commit
970bea97d9
|
@ -87,7 +87,7 @@ def set_rules(policies, overwrite=True):
|
|||
|
||||
def _is_attribute_explicitly_set(attribute_name, resource, target, action):
|
||||
"""Verify that an attribute is present and is explicitly set."""
|
||||
if 'update' in action:
|
||||
if target.get(const.ATTRIBUTES_TO_UPDATE):
|
||||
# In the case of update, the function should not pay attention to a
|
||||
# default value of an attribute, but check whether it was explicitly
|
||||
# marked as being updated instead.
|
||||
|
|
|
@ -431,6 +431,12 @@ class NeutronPolicyTestCase(base.BaseTestCase):
|
|||
result = policy._build_match_rule(action, target, None)
|
||||
self.assertEqual("rule:" + action, str(result))
|
||||
|
||||
def test_build_match_rule_normal_pluralized_when_update(self):
|
||||
action = "update_" + FAKE_RESOURCE_NAME
|
||||
target = {}
|
||||
result = policy._build_match_rule(action, target, None)
|
||||
self.assertEqual("rule:" + action, str(result))
|
||||
|
||||
def test_enforce_subattribute(self):
|
||||
action = "create_" + FAKE_RESOURCE_NAME
|
||||
target = {'tenant_id': 'fake', 'attr': {'sub_attr_1': 'x'}}
|
||||
|
|
Loading…
Reference in New Issue