Esempio n. 1
0
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.
"""Rules-based Policy Engine."""

from keystone import config
from keystone import exception
from keystone import policy
from keystone.common import logging
from keystone.common import policy as common_policy
from keystone.common import utils
from keystone.openstack.common import cfg

policy_opts = [
    cfg.StrOpt('policy_file',
               default='policy.json',
               help=_('JSON file representing policy')),
    cfg.StrOpt('policy_default_rule',
               default='default',
               help=_('Rule checked when requested rule is not found')),
]

CONF = config.CONF
CONF.register_opts(policy_opts)

LOG = logging.getLogger(__name__)

_POLICY_PATH = None
_POLICY_CACHE = {}

Esempio n. 2
0
def register_cli_str(*args, **kw):
    conf = kw.pop('conf', CONF)
    group = kw.pop('group', None)
    return conf.register_cli_opt(cfg.StrOpt(*args, **kw), group=group)
Esempio n. 3
0
def register_cli_str(*args, **kw):
    conf = kw.pop('conf', CONF)
    group = _ensure_group(kw, conf)
    return conf.register_cli_opt(cfg.StrOpt(*args, **kw), group=group)