diff options
author | Kseniya Tychkova <ktychkova@mirantis.com> | 2016-07-13 14:39:56 +0300 |
---|---|---|
committer | Kseniya Tychkova <ktychkova@mirantis.com> | 2016-07-13 14:39:56 +0300 |
commit | 5273d2c3a15c8807d80547bdb88707ba69defc05 (patch) | |
tree | 978f5394fccef426b0ffb60b59beb18bcd05480f | |
parent | 202340cebdf3d7801613cff4f21b3e4024cd5ac0 (diff) | |
download | oslo-policy-5273d2c3a15c8807d80547bdb88707ba69defc05.tar.gz |
Adds debug logging for policy file validation
Simple solution to make debug easier
Change-Id: Ie5704f444b22f32876156277595408424c0ac38e
Closes-Bug: 1588552
-rw-r--r-- | oslo_policy/policy.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/oslo_policy/policy.py b/oslo_policy/policy.py index cd4c201..f658c0e 100644 --- a/oslo_policy/policy.py +++ b/oslo_policy/policy.py @@ -338,11 +338,7 @@ class Rules(dict): """ parsed_file = parse_file_contents(data) - - # Parse the rules - rules = {k: _parser.parse_rule(v) for k, v in parsed_file.items()} - - return cls(rules, default_rule) + return cls.from_dict(parsed_file, default_rule) @classmethod def load_json(cls, data, default_rule=None): @@ -364,7 +360,10 @@ class Rules(dict): """Allow loading of rule data from a dictionary.""" # Parse the rules stored in the dictionary - rules = {k: _parser.parse_rule(v) for k, v in rules_dict.items()} + rules = dict() + for k, v in rules_dict.items(): + LOG.debug('Processing policy: "%s": "%s"', k, v) + rules[k] = _parser.parse_rule(v) return cls(rules, default_rule) |