From cdb444dc9fa6891d21a867e22941797b704c9e3e Mon Sep 17 00:00:00 2001 From: Roopak Parikh Date: Wed, 13 Apr 2016 10:48:04 -0700 Subject: [PATCH] Lease handler not deleting some VMs. After running one of the DUs for last two days noticed an error in the log. It was on obvious error and revealed gaps in my test. Added the fix and a unit test to fix the problem. --- mors/leasehandler/nova_lease_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mors/leasehandler/nova_lease_handler.py b/mors/leasehandler/nova_lease_handler.py index 074c539..90e8a92 100644 --- a/mors/leasehandler/nova_lease_handler.py +++ b/mors/leasehandler/nova_lease_handler.py @@ -11,7 +11,7 @@ DATE_FORMAT = "%Y-%m-%dT%H:%M:%SZ" def get_vm_data(data): return {'instance_uuid': data.id, 'tenant_uuid': data.tenant_id, - 'created_at': datetime.strptime(data.created)} + 'created_at': datetime.strptime(data.created, DATE_FORMAT)} class NovaLeaseHandler: def __init__(self, conf):