Fix rbac_rule_validation log statement raises TypeError
If an OverPermission error occurs, then the LOG.error statement
that should execute throws a TypeError due to a minor syntax issue.
Example: http://logs.openstack.org/31/466331/6/check/gate-tempest-dsvm-patrole-member-ubuntu-xenial/dc38b01/console.html
Change-Id: I3f7fde708521cfd200fd0835a6f2d697ed83b08b
Closes-Bug: #1693297
diff --git a/patrole_tempest_plugin/rbac_rule_validation.py b/patrole_tempest_plugin/rbac_rule_validation.py
index 60a0f10..c63ef90 100644
--- a/patrole_tempest_plugin/rbac_rule_validation.py
+++ b/patrole_tempest_plugin/rbac_rule_validation.py
@@ -116,7 +116,7 @@
else:
if not allowed:
LOG.error("Role %s was allowed to perform %s",
- (role, rule))
+ role, rule)
raise rbac_exceptions.RbacOverPermission(
"OverPermission: Role %s was allowed to perform %s" %
(role, rule))
diff --git a/patrole_tempest_plugin/tests/unit/test_rbac_rule_validation.py b/patrole_tempest_plugin/tests/unit/test_rbac_rule_validation.py
index 9d34a15..a90ec2a 100644
--- a/patrole_tempest_plugin/tests/unit/test_rbac_rule_validation.py
+++ b/patrole_tempest_plugin/tests/unit/test_rbac_rule_validation.py
@@ -252,10 +252,9 @@
self.mock_args)
self.assertIn(("OverPermission: Role Member was allowed to perform "
"sentinel.action"), e.__str__())
-
mock_log.error.assert_called_once_with(
- 'Role %s was allowed to perform %s', ('Member',
- mock.sentinel.action))
+ 'Role %s was allowed to perform %s', 'Member',
+ mock.sentinel.action)
@mock.patch.object(rbac_rv, 'rbac_policy_parser', autospec=True)
def test_invalid_policy_rule_throws_parsing_exception(