コード例 #1
0
ファイル: policy.py プロジェクト: vefimova/cinder
 def _load_policy_file(self, path, force_reload, overwrite=True):
     reloaded, data = fileutils.read_cached_file(path,
                                                 force_reload=force_reload)
     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("Reloaded policy file: %(path)s", {'path': path})
コード例 #2
0
ファイル: policy.py プロジェクト: NicolasT/cinder
 def _load_policy_file(self, path, force_reload, overwrite=True):
         reloaded, data = fileutils.read_cached_file(
             path, force_reload=force_reload)
         if reloaded or not self.rules:
             rules = Rules.load_json(data, self.default_rule)
             self.set_rules(rules, overwrite)
             LOG.debug("Rules successfully reloaded")
コード例 #3
0
 def _load_policy_file(self, path, force_reload, overwrite=True):
     reloaded, data = fileutils.read_cached_file(path,
                                                 force_reload=force_reload)
     if reloaded or not self.rules:
         rules = Rules.load_json(data, self.default_rule)
         self.set_rules(rules, overwrite)
         LOG.debug("Rules successfully reloaded")
コード例 #4
0
ファイル: policy.py プロジェクト: samsong8610/cinder
 def _load_policy_file(self, path, force_reload, overwrite=True):
         reloaded, data = fileutils.read_cached_file(
             path, force_reload=force_reload)
         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("Reloaded policy file: %(path)s",
                       {'path': path})
コード例 #5
0
ファイル: policy.py プロジェクト: HybridCloud-dew/hws
    def load_rules(self, force_reload=False):
        """Loads policy_path's rules.

        Policy file is cached and will be reloaded if modified.

        :param force_reload: Whether to overwrite current rules.
        """

        if force_reload:
            self.use_conf = force_reload

        if self.use_conf:
            if not self.policy_path:
                self.policy_path = self._get_policy_path()

            reloaded, data = fileutils.read_cached_file(
                self.policy_path, force_reload=force_reload)
            if reloaded or not self.rules:
                rules = Rules.load_json(data, self.default_rule)
                self.set_rules(rules)
                LOG.debug("Rules successfully reloaded")
コード例 #6
0
ファイル: policy.py プロジェクト: ersushantsood/cinder
    def load_rules(self, force_reload=False):
        """Loads policy_path's rules.

        Policy file is cached and will be reloaded if modified.

        :param force_reload: Whether to overwrite current rules.
        """

        if force_reload:
            self.use_conf = force_reload

        if self.use_conf:
            if not self.policy_path:
                self.policy_path = self._get_policy_path()

            reloaded, data = fileutils.read_cached_file(
                self.policy_path, force_reload=force_reload)
            if reloaded or not self.rules:
                rules = Rules.load_json(data, self.default_rule)
                self.set_rules(rules)
                LOG.debug("Rules successfully reloaded")