Skip to content

Commit

Permalink
Updated logic and increased timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
jwcolbert committed Aug 16, 2017
1 parent 52bde86 commit 85bef58
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions clc_ansible_module/clc_server_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,16 @@ def _delete_server_snapshot(self, server, ignore_failures):
server.id, ex.message
))

t_end = time.time() + 300
t_end = time.time() + 600
while time.time() < t_end:
if len(self.clc.v2.Server(server).GetSnapshots()) == 0:
break
if len(self.clc.v2.Server(server).GetSnapshots()) != 0:
self.module.fail_json(msg='Failed to delete snapshot for server : {0}. {1}'.format(
server.id, ex.message))

if ignore_failures:
return None
else:
self.module.fail_json(msg='Failed to delete snapshot for server : {0}.'.format(
server.id))
return result

def ensure_server_snapshot_restore(self, server_ids, ignore_failures):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

setup(
name='clc-ansible-module',
version='1.1.23',
version='1.1.24',
description='Centurylink Cloud Ansible Modules',
author='CenturyLink Cloud',
author_email='[email protected]',
Expand Down

0 comments on commit 85bef58

Please sign in to comment.