import os
import re
-from oslo.config import cfg
-from oslo.serialization import jsonutils
+from oslo_config import cfg
+from oslo_serialization import jsonutils
import six
import six.moves.urllib.parse as urlparse
import six.moves.urllib.request as urlrequest
from cinder.openstack.common import fileutils
-from cinder.openstack.common._i18n import _, _LE, _LI
+from cinder.openstack.common._i18n import _, _LE
policy_opts = [
'in the search path defined by the config_dir '
'option, or absolute paths. The file defined by '
'policy_file must exist for these directories to '
- 'be searched.')),
+ 'be searched. Missing or empty directories are '
+ 'ignored.')),
]
CONF = cfg.CONF
def list_opts():
- """Entry point for oslo.config-generator."""
+ """Entry point for oslo-config-generator."""
return [(None, copy.deepcopy(policy_opts))]
try:
path = self._get_policy_path(path)
except cfg.ConfigFilesNotFoundError:
- LOG.info(_LI("Can not find policy directory: %s"), path)
continue
self._walk_through_policy_directory(path,
self._load_policy_file,
if reloaded or not self.rules or not overwrite:
rules = Rules.load_json(data, self.default_rule)
self.set_rules(rules, overwrite=overwrite, use_conf=True)
- LOG.debug("Rules successfully reloaded")
+ LOG.debug("Reloaded policy file: %(path)s",
+ {'path': path})
def _get_policy_path(self, path):
"""Locate the policy json data file/path.