From 9cf5cc13feb676a54804d793ab5cc1fca447cab5 Mon Sep 17 00:00:00 2001 From: Roopak Parikh Date: Tue, 12 Apr 2016 03:31:33 +0000 Subject: [PATCH] Handling insecure connection Nova lease handler connects through http but it appears that the connection is redirected to the external fqdn which on test systems can cause the connection to fail because of local self signed certificate. --- mors/leasehandler/nova_lease_handler.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mors/leasehandler/nova_lease_handler.py b/mors/leasehandler/nova_lease_handler.py index 8d8fd67..074c539 100644 --- a/mors/leasehandler/nova_lease_handler.py +++ b/mors/leasehandler/nova_lease_handler.py @@ -24,6 +24,7 @@ class NovaLeaseHandler: tenant_id=self.conf.get("nova", "tenant_uuid"), api_key=self.conf.get("nova", "password"), auth_url=self.conf.get("nova", "auth_url"), + insecure=True, # Insecure to handle test systems connection_pool=False) def get_all_vms(self, tenant_uuid): @@ -44,7 +45,7 @@ class NovaLeaseHandler: def _delete_vm(self, nova, vm_uuid): try: logger.info("Deleting VM %s", vm_uuid) - nova.server.delete(vm_uuid) + nova.servers.delete(vm_uuid) return SUCCESS_OK except novaclient.exceptions.NotFound: return ERR_NOT_FOUND @@ -67,4 +68,4 @@ class NovaLeaseHandler: return result except Exception as e: logger.exception("Error deleting vm %s", vms) - return result \ No newline at end of file + return result