Esempio n. 1
0
 def setUp(self):
     super(EngineRpcAPITestCase, self).setUp()
     self.stubs = stubout.StubOutForTesting()
     self.identity = dict(identifier.HeatIdentifier('engine_test_tenant',
                                                    '6',
                                                    'wordpress'))
     self.rpcapi = rpc_client.EngineClient()
Esempio n. 2
0
    def setUp(self):
        messaging.setup("fake://", optional=True)
        self.addCleanup(messaging.cleanup)
        self.context = utils.dummy_context()

        self.stubs = stubout.StubOutForTesting()
        self.identity = dict(
            identifier.HeatIdentifier('engine_test_tenant', '6', 'wordpress'))
        self.rpcapi = rpc_client.EngineClient()
        super(EngineRpcAPITestCase, self).setUp()
Esempio n. 3
0
def do_migrate():
    messaging.setup()
    client = rpc_client.EngineClient()
    ctxt = context.get_admin_context()
    try:
        client.migrate_convergence_1(ctxt, CONF.command.stack_id)
    except exception.NotFound:
        raise Exception(
            _("Stack with id %s can not be found.") % CONF.command.stack_id)
    except (exception.NotSupported, exception.ActionNotComplete) as ex:
        raise Exception(ex.message)
Esempio n. 4
0
def do_migrate():
    messaging.setup()
    client = rpc_client.EngineClient()
    ctxt = context.get_admin_context()
    try:
        client.migrate_convergence_1(ctxt, CONF.command.stack_id)
    except exception.NotFound:
        raise Exception(
            _("Stack with id %s can not be found.") % CONF.command.stack_id)
    except exception.ActionInProgress:
        raise Exception(
            _("The stack or some of its nested stacks are "
              "in progress. Note, that all the stacks should be "
              "in COMPLETE state in order to be migrated."))
Esempio n. 5
0
    def __call__(self, env, start_response):
        """
        Handle incoming request.

        Authenticate send downstream on success. Reject request if
        we can't authenticate.
        """
        LOG.debug(_('Authenticating user token'))
        context = local.store.context
        engine = rpc_client.EngineClient()
        authenticated = engine.authenticated_to_backend(context)
        if authenticated:
            return self.app(env, start_response)
        else:
            return self._reject_request(env, start_response)
Esempio n. 6
0
 def __init__(self, options):
     self.options = options
     self.rpc_client = rpc_client.EngineClient()
Esempio n. 7
0
 def __init__(self, app, conf):
     self.conf = conf
     self.app = app
     self.rpc_client = rpc_client.EngineClient()
Esempio n. 8
0
 def __init__(self, options):
     self.options = options
     self.rpc_client = rpc_client.EngineClient()
     self.policy = policy.Enforcer(scope='cloudwatch')
Esempio n. 9
0
 def __init__(self, options):
     self.options = options
     self.engine_rpcapi = rpc_client.EngineClient()
     self.policy = policy.Enforcer(scope='cloudformation')
Esempio n. 10
0
 def rpc_client(self):
     '''Return a client for making engine RPC calls.'''
     if not self._rpc_client:
         self._rpc_client = rpc_client.EngineClient()
     return self._rpc_client