Change name of rbac_role_converter to rbac_policy_parser.
This patch simply changes the name of the file and class of
rbac_role_converter/RbacPolicyConverter to the more accurate
name of rbac_policy_parser/RbacPolicyParser, because no "conversion"
is actually performed; instead the policy file is parsed and the
contents of which are passed to oslo_policy, which if anything does
the actual conversion.
Also fixes a bug in the event that an Exception is caught
in rbac_policy_parser: when an Exception is thrown, `rule` is never
defined, resulting in a NameError in _try_rule. `rule` is changed
to `apply_rule` to resolve this.
Change-Id: I978c5134f8ab922b7fb3d9c901c936dee2f62f8b
diff --git a/patrole_tempest_plugin/rbac_auth.py b/patrole_tempest_plugin/rbac_auth.py
index 1afc7ae..40a46a7 100644
--- a/patrole_tempest_plugin/rbac_auth.py
+++ b/patrole_tempest_plugin/rbac_auth.py
@@ -15,15 +15,15 @@
from oslo_log import log as logging
-from patrole_tempest_plugin import rbac_role_converter
+from patrole_tempest_plugin import rbac_policy_parser
LOG = logging.getLogger(__name__)
class RbacAuthority(object):
def __init__(self, tenant_id, service=None):
- self.converter = rbac_role_converter.RbacPolicyConverter(tenant_id,
- service)
+ self.converter = rbac_policy_parser.RbacPolicyParser(tenant_id,
+ service)
def get_permission(self, rule_name, role):
try: