예제 #1
0
파일: rpcapi.py 프로젝트: bopopescu/jacket
 def __init__(self, topic=None, server=None):
     super(ConsoleAPI, self).__init__()
     topic = topic if topic else CONF.console_topic
     target = messaging.Target(topic=topic, server=server, version='2.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.console,
                                            CONF.upgrade_levels.console)
     self.client = rpc.get_client(target, version_cap=version_cap)
예제 #2
0
 def __init__(self):
     super(ComputeTaskAPI, self).__init__()
     target = messaging.Target(topic=CONF.conductor.topic,
                               namespace='compute_task',
                               version='1.0')
     serializer = objects_base.NovaObjectSerializer()
     self.client = rpc.get_client(target, serializer=serializer)
예제 #3
0
파일: rpcapi.py 프로젝트: bopopescu/jacket
 def __init__(self):
     super(SchedulerAPI, self).__init__()
     target = messaging.Target(topic=CONF.scheduler_topic, version='4.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.scheduler,
                                            CONF.upgrade_levels.scheduler)
     serializer = objects_base.NovaObjectSerializer()
     self.client = rpc.get_client(target, version_cap=version_cap,
                                  serializer=serializer)
예제 #4
0
파일: baserpc.py 프로젝트: bopopescu/jacket
 def __init__(self, topic):
     super(BaseAPI, self).__init__()
     target = messaging.Target(topic=topic,
                               namespace=_NAMESPACE,
                               version='1.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.baseapi,
                                            CONF.upgrade_levels.baseapi)
     self.client = rpc.get_client(target, version_cap=version_cap)
예제 #5
0
파일: rpcapi.py 프로젝트: bopopescu/jacket
 def __init__(self, topic=None):
     super(NetworkAPI, self).__init__()
     topic = topic or CONF.network_topic
     target = messaging.Target(topic=topic, version='1.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.network,
                                            CONF.upgrade_levels.network)
     serializer = objects_base.NovaObjectSerializer()
     self.client = rpc.get_client(target, version_cap, serializer)
예제 #6
0
파일: rpcapi.py 프로젝트: HybridF5/jacket
 def __init__(self):
     super(ConductorAPI, self).__init__()
     target = messaging.Target(topic=CONF.conductor.topic, version='3.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.conductor,
                                            CONF.upgrade_levels.conductor)
     serializer = objects_base.NovaObjectSerializer()
     self.client = rpc.get_client(target,
                                  version_cap=version_cap,
                                  serializer=serializer)
예제 #7
0
 def __init__(self):
     target = messaging.Target(topic='hyper-agent-vif-update',
                               version='1.0',
                               exchange='hyperagent')
     serializer = objects_base.JacketObjectSerializer()
     self.client = rpc.get_client(target, serializer=serializer)
     self.client.timeout = HyperAgentAPI.plug_retry_timeout
     self.context = nova_context.get_admin_context()
     self.call_back = HyperAgentCallback()
     super(HyperAgentAPI, self).__init__()
예제 #8
0
 def __init__(self):
     super(CellsAPI, self).__init__()
     target = messaging.Target(topic=CONF.cells.topic, version='1.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.cells,
                                            CONF.upgrade_levels.cells)
     # NOTE(sbauza): Yes, this is ugly but cells_utils is calling cells.db
     # which itself calls cells.rpcapi... You meant import cycling ? Gah.
     from jacket.compute.cells import utils as cells_utils
     serializer = cells_utils.ProxyObjectSerializer()
     self.client = rpc.get_client(target,
                                  version_cap=version_cap,
                                  serializer=serializer)
예제 #9
0
파일: test_rpc.py 프로젝트: HybridF5/jacket
    def test_get_client(self, mock_client, mock_ser):
        rpc.TRANSPORT = mock.Mock()
        tgt = mock.Mock()
        ser = mock.Mock()
        mock_client.return_value = 'client'
        mock_ser.return_value = ser

        client = rpc.get_client(tgt, version_cap='1.0', serializer='foo')

        mock_ser.assert_called_once_with('foo')
        mock_client.assert_called_once_with(rpc.TRANSPORT,
                                            tgt, version_cap='1.0',
                                            serializer=ser)
        self.assertEqual('client', client)
예제 #10
0
파일: rpcapi.py 프로젝트: HybridF5/jacket
 def get_client(self, target, version_cap, serializer):
     return rpc.get_client(target,
                           version_cap=version_cap,
                           serializer=serializer)
예제 #11
0
파일: rpcapi.py 프로젝트: bopopescu/jacket
 def get_client(self, target, version_cap, serializer):
     return rpc.get_client(target,
                           version_cap=version_cap,
                           serializer=serializer)
예제 #12
0
파일: rpcapi.py 프로젝트: HybridF5/jacket
 def __init__(self):
     super(CertAPI, self).__init__()
     target = messaging.Target(topic=CONF.cert_topic, version='2.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.cert,
                                            CONF.upgrade_levels.cert)
     self.client = rpc.get_client(target, version_cap=version_cap)
예제 #13
0
파일: rpcapi.py 프로젝트: HybridF5/jacket
 def __init__(self):
     super(ConsoleAuthAPI, self).__init__()
     target = messaging.Target(topic=CONF.consoleauth_topic, version='2.1')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.consoleauth,
                                            CONF.upgrade_levels.consoleauth)
     self.client = rpc.get_client(target, version_cap=version_cap)
예제 #14
0
파일: rpcapi.py 프로젝트: bopopescu/jacket
 def __init__(self):
     super(CertAPI, self).__init__()
     target = messaging.Target(topic=CONF.cert_topic, version='2.0')
     version_cap = self.VERSION_ALIASES.get(CONF.upgrade_levels.cert,
                                            CONF.upgrade_levels.cert)
     self.client = rpc.get_client(target, version_cap=version_cap)
예제 #15
0
 def can_send_version(self, version):
     client = rpc.get_client(self.target, version_cap=self.version_cap)
     return client.can_send_version(version)
예제 #16
0
 def _check_version_cap(self, version):
     client = rpc.get_client(self.target, version_cap=self.version_cap)
     if not client.can_send_version(version):
         raise messaging.RPCVersionCapError(version=version,
                                            version_cap=self.version_cap)