From 2228f6d16accc012eadff59d44b7fd475256c36a Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Mon, 24 Aug 2015 02:31:45 -0700 Subject: [PATCH] Remove _extract_roles method from neutron.policy This method is not used anymore as it was called only from the get_admin_roles method. This method has been removed by commit 734e77365b0f241a3cea0f3c9dfb1d5fcf6eac8c; therefore the _extract_roles method is now zombie code and should be removed before it starts feeding on Neutron's brain. Related-Bug: #1445690 Change-Id: I0306bcea813031897e319af9693e18d03848e378 --- neutron/policy.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/neutron/policy.py b/neutron/policy.py index e1d955a60..d3bc5c631 100644 --- a/neutron/policy.py +++ b/neutron/policy.py @@ -411,13 +411,3 @@ def check_is_advsvc(context): if ADVSVC_CTX_POLICY not in _ENFORCER.rules: return False return _ENFORCER.enforce(ADVSVC_CTX_POLICY, credentials, credentials) - - -def _extract_roles(rule, roles): - if isinstance(rule, policy.RoleCheck): - roles.append(rule.match.lower()) - elif isinstance(rule, policy.RuleCheck): - _extract_roles(_ENFORCER.rules[rule.match], roles) - elif hasattr(rule, 'rules'): - for rule in rule.rules: - _extract_roles(rule, roles) -- 2.45.2