]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Log msg for load policy file only if the file is actually loaded
authorSalvatore Orlando <salv.orlando@gmail.com>
Sun, 5 May 2013 15:29:37 +0000 (17:29 +0200)
committerSalvatore Orlando <salv.orlando@gmail.com>
Mon, 6 May 2013 22:59:23 +0000 (00:59 +0200)
The Load entry was previousy in init(), whereas it should have
been in _set_rules() which is invoked only when policies are
(re)loaded from the json file.

Change-Id: Ib4ce66569a64fc4be8f5f77d7f503cc93ac0006e

quantum/policy.py

index 7d101a4556d2f39dc31b31b2121882346d631b30..3f74dff9594397a3cf89e311dc0ddee6c4910c8b 100644 (file)
@@ -52,7 +52,6 @@ def init():
             raise exceptions.PolicyNotFound(path=cfg.CONF.policy_file)
     # pass _set_brain to read_cached_file so that the policy brain
     # is reset only if the file has changed
-    LOG.debug(_("loading policy file at %s"), _POLICY_PATH)
     utils.read_cached_file(_POLICY_PATH, _POLICY_CACHE,
                            reload_func=_set_rules)
 
@@ -65,6 +64,7 @@ def get_resource_and_action(action):
 
 def _set_rules(data):
     default_rule = 'default'
+    LOG.debug(_("loading policies from file: %s"), _POLICY_PATH)
     policy.set_rules(policy.Rules.load_json(data, default_rule))