예제 #1
0
def init_policy():
    LOG.info('Initializing Policy')

    with open(utils.find_config(cfg.CONF.policy_file)) as fh:
        policy_json = fh.read()

    rules = policy.Rules.load_json(policy_json, cfg.CONF.policy_default_rule)
    policy.set_rules(rules)
예제 #2
0
    def __init__(self, backlog=128, threads=1000):
        super(Service, self).__init__(threads)

        self.host = cfg.CONF.api_host
        self.port = cfg.CONF.api_port
        self.backlog = backlog

        config_path = cfg.CONF.api_paste_config
        config_path = utils.find_config(config_path)

        self.application = deploy.loadapp("config:%s" % config_path,
                                          name='osapi_dns')
예제 #3
0
    def __init__(self, backlog=128, threads=1000):
        super(Service, self).__init__(threads)

        self.host = cfg.CONF.api_host
        self.port = cfg.CONF.api_port
        self.backlog = backlog

        config_path = cfg.CONF.api_paste_config
        config_path = utils.find_config(config_path)

        self.application = deploy.loadapp("config:%s" % config_path,
                                          name='osapi_dns')
예제 #4
0
def init_policy():
    LOG.info('Initializing Policy')

    policy_files = utils.find_config(cfg.CONF.policy_file)

    if len(policy_files) == 0:
        msg = 'Unable to determine appropriate policy json file'
        raise exceptions.ConfigurationError(msg)

    LOG.info('Using policy_file found at: %s' % policy_files[0])

    with open(policy_files[0]) as fh:
        policy_json = fh.read()

    rules = policy.Rules.load_json(policy_json, cfg.CONF.policy_default_rule)

    policy.set_rules(rules)
예제 #5
0
def init_policy():
    LOG.info('Initializing Policy')

    policy_files = utils.find_config(cfg.CONF.policy_file)

    if len(policy_files) == 0:
        msg = 'Unable to determine appropriate policy json file'
        raise exceptions.ConfigurationError(msg)

    LOG.info('Using policy_file found at: %s' % policy_files[0])

    with open(policy_files[0]) as fh:
        policy_json = fh.read()

    rules = policy.Rules.load_json(policy_json, cfg.CONF.policy_default_rule)

    policy.set_rules(rules)
예제 #6
0
    def __init__(self, backlog=128, threads=1000):

        api_paste_config = cfg.CONF['service:api'].api_paste_config
        config_paths = utils.find_config(api_paste_config)

        if len(config_paths) == 0:
            msg = 'Unable to determine appropriate api-paste-config file'
            raise exceptions.ConfigurationError(msg)

        LOG.info('Using api-paste-config found at: %s' % config_paths[0])

        policy.init_policy()

        application = deploy.loadapp("config:%s" % config_paths[0],
                                     name='osapi_dns')

        super(Service, self).__init__(application=application,
                                      host=cfg.CONF['service:api'].api_host,
                                      port=cfg.CONF['service:api'].api_port,
                                      backlog=backlog,
                                      threads=threads)