Exemplo n.º 1
0
    def start(self):
        if CONF.engine.disable_murano_agent:
            # Noop
            LOG.debug("murano-agent is disabled by the server")
            return

        if self._receive_thread is None:
            helpers.get_environment().on_session_finish(lambda: self.stop())
            self._receive_thread = eventlet.spawn(self._receive)
Exemplo n.º 2
0
    def start(self, _context):
        if config.CONF.engine.disable_murano_agent:
            # Noop
            LOG.debug("murano-agent is disabled by the server")
            return

        if self._receive_thread is None:
            helpers.get_environment(_context).on_session_finish(
                lambda: self.stop())
            self._receive_thread = eventlet.spawn(self._receive)
Exemplo n.º 3
0
    def initialize(self, _context):
        environment = helpers.get_environment(_context)
        self._tenant_id = environment.tenant_id
        keystone_settings = config.CONF.keystone
        neutron_settings = config.CONF.neutron
        self._settings = config.CONF.networking

        keystone_client = ksclient.Client(endpoint=keystone_settings.auth_url,
                                          cacert=keystone_settings.ca_file
                                          or None,
                                          cert=keystone_settings.cert_file
                                          or None,
                                          key=keystone_settings.key_file
                                          or None,
                                          insecure=keystone_settings.insecure)

        if not keystone_client.authenticate(
                auth_url=keystone_settings.auth_url,
                tenant_id=environment.tenant_id,
                token=environment.token):
            raise ks_exc.AuthorizationFailure()

        neutron_url = keystone_client.service_catalog.url_for(
            service_type='network',
            endpoint_type=neutron_settings.endpoint_type)

        self._neutron = \
            nclient.Client(endpoint_url=neutron_url,
                           token=environment.token,
                           ca_cert=neutron_settings.ca_cert or None,
                           insecure=neutron_settings.insecure)

        self._available_cidrs = self._generate_possible_cidrs()
Exemplo n.º 4
0
 def initialize(self, _context, name, description=None):
     self._name = name
     self._template = None
     self._parameters = {}
     self._applied = True
     self._description = description
     self._clients = helpers.get_environment(_context).clients
Exemplo n.º 5
0
 def initialize(self, _context, name, description=None):
     self._name = name
     self._template = None
     self._parameters = {}
     self._applied = True
     self._description = description
     self._clients = helpers.get_environment(_context).clients
Exemplo n.º 6
0
    def initialize(self, _context):
        environment = helpers.get_environment(_context)
        self._tenant_id = environment.tenant_id
        keystone_settings = config.CONF.keystone
        neutron_settings = config.CONF.neutron
        self._settings = config.CONF.networking

        keystone_client = ksclient.Client(
            endpoint=keystone_settings.auth_url,
            cacert=keystone_settings.ca_file or None,
            cert=keystone_settings.cert_file or None,
            key=keystone_settings.key_file or None,
            insecure=keystone_settings.insecure)

        if not keystone_client.authenticate(
                auth_url=keystone_settings.auth_url,
                tenant_id=environment.tenant_id,
                token=environment.token):
            raise ks_exc.AuthorizationFailure()

        neutron_url = keystone_client.service_catalog.url_for(
            service_type='network',
            endpoint_type=neutron_settings.endpoint_type)

        self._neutron = \
            nclient.Client(endpoint_url=neutron_url,
                           token=environment.token,
                           ca_cert=neutron_settings.ca_cert or None,
                           insecure=neutron_settings.insecure)

        self._available_cidrs = self._generate_possible_cidrs()
Exemplo n.º 7
0
 def __init__(self, name, description=None):
     self._name = name
     self._template = None
     self._parameters = {}
     self._files = {}
     self._hot_environment = ''
     self._applied = True
     self._description = description
     self._clients = helpers.get_environment().clients
     self._last_stack_timestamps = (None, None)
Exemplo n.º 8
0
 def __init__(self, name, description=None):
     self._name = name
     self._template = None
     self._parameters = {}
     self._files = {}
     self._hot_environment = ''
     self._applied = True
     self._description = description
     self._clients = helpers.get_environment().clients
     self._last_stack_timestamps = (None, None)
Exemplo n.º 9
0
    def initialize(self, _context, name, description=None):
        self._name = name
        self._template = None
        self._parameters = {}
        self._applied = True
        self._description = description
        environment = helpers.get_environment(_context)
        keystone_settings = config.CONF.keystone
        heat_settings = config.CONF.heat

        client = ksclient.Client(
            endpoint=keystone_settings.auth_url,
            cacert=keystone_settings.ca_file or None,
            cert=keystone_settings.cert_file or None,
            key=keystone_settings.key_file or None,
            insecure=keystone_settings.insecure)

        if not client.authenticate(
                auth_url=keystone_settings.auth_url,
                tenant_id=environment.tenant_id,
                token=environment.token):
            raise heat_exc.HTTPUnauthorized()

        heat_url = client.service_catalog.url_for(
            service_type='orchestration',
            endpoint_type=heat_settings.endpoint_type)

        self._heat_client = hclient.Client(
            '1',
            heat_url,
            username='******',
            password='******',
            token_only=True,
            token=client.auth_token,
            ca_file=heat_settings.ca_file or None,
            cert_file=heat_settings.cert_file or None,
            key_file=heat_settings.key_file or None,
            insecure=heat_settings.insecure)
Exemplo n.º 10
0
    def initialize(self, _context, name, description=None):
        self._name = name
        self._template = None
        self._parameters = {}
        self._applied = True
        self._description = description
        environment = helpers.get_environment(_context)
        keystone_settings = config.CONF.keystone
        heat_settings = config.CONF.heat

        client = ksclient.Client(endpoint=keystone_settings.auth_url,
                                 cacert=keystone_settings.ca_file or None,
                                 cert=keystone_settings.cert_file or None,
                                 key=keystone_settings.key_file or None,
                                 insecure=keystone_settings.insecure)

        if not client.authenticate(auth_url=keystone_settings.auth_url,
                                   tenant_id=environment.tenant_id,
                                   token=environment.token):
            raise heat_exc.HTTPUnauthorized()

        heat_url = client.service_catalog.url_for(
            service_type='orchestration',
            endpoint_type=heat_settings.endpoint_type)

        self._heat_client = hclient.Client('1',
                                           heat_url,
                                           username='******',
                                           password='******',
                                           token_only=True,
                                           token=client.auth_token,
                                           ca_file=heat_settings.ca_file
                                           or None,
                                           cert_file=heat_settings.cert_file
                                           or None,
                                           key_file=heat_settings.key_file
                                           or None,
                                           insecure=heat_settings.insecure)
Exemplo n.º 11
0
 def start_env(self):
     env = helpers.get_environment()
     env.start()
Exemplo n.º 12
0
 def finish_env(self):
     env = helpers.get_environment()
     env.finish()
Exemplo n.º 13
0
 def initialize(self, _context):
     client_manager = helpers.get_environment(_context).clients
     self.client = client_manager.get_client(_context, "glance", True,
                                             self.create_glance_client)
Exemplo n.º 14
0
 def __init__(self):
     environment = helpers.get_environment()
     self._clients = environment.clients
     self._tenant_id = environment.tenant_id
     self._settings = CONF.networking
     self._available_cidrs = self._generate_possible_cidrs()
Exemplo n.º 15
0
 def initialize(self, _context):
     environment = helpers.get_environment(_context)
     self._clients = environment.clients
     self._tenant_id = environment.tenant_id
     self._settings = config.CONF.networking
     self._available_cidrs = self._generate_possible_cidrs()
Exemplo n.º 16
0
 def __init__(self, context):
     self._clients = helpers.get_environment(context).clients
Exemplo n.º 17
0
 def __init__(self, context):
     client_manager = helpers.get_environment(context).clients
     self.client = client_manager.get_client(context, "glance", True,
                                             self.create_glance_client)
Exemplo n.º 18
0
 def finish_env(self):
     env = helpers.get_environment()
     env.finish()
Exemplo n.º 19
0
 def start_env(self):
     env = helpers.get_environment()
     env.start()
Exemplo n.º 20
0
 def _get_environment(self, context):
     if isinstance(context, environment.Environment):
         return context
     return helpers.get_environment(context)
Exemplo n.º 21
0
 def __init__(self):
     environment = helpers.get_environment()
     self._clients = environment.clients
     self._tenant_id = environment.tenant_id
     self._settings = CONF.networking
     self._available_cidrs = self._generate_possible_cidrs()
Exemplo n.º 22
0
 def _get_environment(self, context):
     if isinstance(context, environment.Environment):
         return context
     return helpers.get_environment(context)
Exemplo n.º 23
0
 def environment(self):
     return helpers.get_environment()
Exemplo n.º 24
0
 def initialize(self, _context):
     self._clients = helpers.get_environment(_context).clients
Exemplo n.º 25
0
 def initialize(self, _context):
     self._clients = helpers.get_environment(_context).clients
Exemplo n.º 26
0
 def initialize(self, _context):
     environment = helpers.get_environment(_context)
     self._clients = environment.clients
     self._tenant_id = environment.tenant_id
     self._settings = config.CONF.networking
     self._available_cidrs = self._generate_possible_cidrs()
Exemplo n.º 27
0
 def initialize(self, _context):
     client_manager = helpers.get_environment(_context).clients
     self.client = client_manager.get_client(_context, "glance", True,
                                             self.create_glance_client)
Exemplo n.º 28
0
 def environment(self):
     return helpers.get_environment()
Exemplo n.º 29
0
 def __init__(self, context):
     self._clients = helpers.get_environment(context).clients