Fix volume remove command polling wrong metadata 67/10067/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Tue, 17 Apr 2018 18:18:18 +0000 (14:18 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Tue, 17 Apr 2018 18:18:31 +0000 (14:18 -0400)
Volumes use created_at instead of created.

Change-Id: I53a11dc791ee2d4035f9b641f97c019f2f19610f
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
lftools/openstack/volume.py

index 3e0367c..0b94d56 100644 (file)
@@ -86,7 +86,7 @@ def remove(os_cloud, volume_name, minutes=0):
         print("ERROR: volume not found.")
         sys.exit(1)
 
-    if (datetime.strptime(volume.created, '%Y-%m-%dT%H:%M:%SZ')
+    if (datetime.strptime(volume.created_at, '%Y-%m-%dT%H:%M:%SZ')
             >= datetime.utcnow() - timedelta(minutes=minutes)):
         print('WARN: volume "{}" is not older than {} minutes.'.format(
             volume.name, minutes))