Creation/Update of Network RBAC policies is broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ansible-collections-openstack |
New
|
Undecided
|
Unassigned |
Bug Description
There is a bug in /plugins/
When checking the match against the specified parameters, "all" should be used instead of "any". As it is now, _find_matches returns partial matches (several policies belonging to the same project, but for different object for example.). This then results in _find failing with 'Found more a single matching RBAC policy which match the given parameters.'. There is also a typo in that error, by the way.
Suggested fix, correcting both problems:
--- a/plugins/
+++ b/plugins/
@@ -252,7 +252,7 @@ class NeutronRBACPoli
matches = self._find_
if len(matches) > 1:
- self.fail_
+ self.fail_
elif len(matches) == 1:
return matches[0]
@@ -274,7 +274,7 @@ class NeutronRBACPoli
policies = self.conn.
return [p for p in policies
- if any(p[k] == self.params[k]
+ if all(p[k] == self.params[k]
def _update(self, policy, update):