Exemple #1
0
    def __init__(self, conf, name=None, userdata=None, metadata=None,
                 availability_zone=None):
        super(BaseHeatBackend, self).__init__(
            conf, name=name, userdata=userdata, metadata=metadata,
            availability_zone=availability_zone)

        self._manager = api_manager.APIManager()
        self._heat_client = client.heat_client(
            self._manager.primary_credentials())
        self._keypair = None
Exemple #2
0
    def __init__(self, conf, name=None, userdata=None, metadata=None,
                 availability_zone=None):
        super(BaseHeatBackend, self).__init__(
            conf, name=name, userdata=userdata, metadata=metadata,
            availability_zone=availability_zone)

        self._manager = api_manager.APIManager()
        self._heat_client = client.heat_client(
            self._manager.primary_credentials())
        self._keypair = None
    def test_heat_client(self, mock_kssession, mock_env, mock_get_ks_auth):
        mock_env.return_value = mock.sentinel
        mock_get_endpoint = mock.Mock()
        mock_get_endpoint.get_endpoint.return_value = mock.sentinel
        mock_get_ks_auth.return_value = mock_get_endpoint

        class Credentials(object):
            def __init__(self):
                self.username = "******"
                self.user_id = "fake user id"
                self.password = "******"
                self.tenant_id = "fake tenant id"
                self.tenant_name = "fake tenant name"

        credentials = Credentials()
        result = client.heat_client(credentials)
        self.assertTrue(result, heatclient_client.Client)
        mock_kssession.assert_called_once_with(verify=True)
        mock_env.assert_called_once_with('OS_AUTH_URL')
Exemple #4
0
    def test_heat_client(self, mock_kssession, mock_env, mock_get_ks_auth):
        mock_env.return_value = mock.sentinel
        mock_get_endpoint = mock.Mock()
        mock_get_endpoint.get_endpoint.return_value = mock.sentinel
        mock_get_ks_auth.return_value = mock_get_endpoint

        class Credentials(object):
            def __init__(self):
                self.username = "******"
                self.user_id = "fake user id"
                self.password = "******"
                self.tenant_id = "fake tenant id"
                self.tenant_name = "fake tenant name"

        credentials = Credentials()
        result = client.heat_client(credentials)
        self.assertTrue(result, heatclient_client.Client)
        mock_kssession.assert_called_once_with(verify=True)
        mock_env.assert_called_once_with('OS_AUTH_URL')