diff --git a/mors/leasehandler/nova_lease_handler.py b/mors/leasehandler/nova_lease_handler.py index 04324a8..1786677 100644 --- a/mors/leasehandler/nova_lease_handler.py +++ b/mors/leasehandler/nova_lease_handler.py @@ -31,9 +31,7 @@ def get_vm_data(data): class NovaLeaseHandler: def __init__(self, conf): self.conf = conf - - def _get_nova_client(self): - return client.Client(self.conf.get("nova", "version"), + self.nova_client = client.Client(self.conf.get("nova", "version"), username=self.conf.get("nova", "user_name"), region_name=self.conf.get("nova", "region_name"), tenant_id=self.conf.get("nova", "tenant_uuid"), @@ -42,6 +40,9 @@ class NovaLeaseHandler: insecure=True, # Insecure to handle test systems connection_pool=False) + def _get_nova_client(self): + return self.nova_client + def get_all_vms(self, tenant_uuid): """ Get all vms for a given tenant