Merge pull request #27246 from garethgreenaway/develop_ec2_create_snapshot_exception

Develop - cloud.ec2.create_snapshot exception
This commit is contained in:
Mike Place 2015-09-18 15:41:29 -06:00
commit 9c174e9fc2

View File

@ -3924,15 +3924,17 @@ def create_snapshot(kwargs=None, call=None, wait_to_finish=False):
for d in data:
for k, v in six.iteritems(d):
r_data[k] = v
snapshot_id = r_data['snapshotId']
# Waits till volume is available
if wait_to_finish:
salt.utils.cloud.run_func_until_ret_arg(fun=describe_snapshots,
kwargs={'snapshot_id': snapshot_id},
fun_call=call,
argument_being_watched='status',
required_argument_response='completed')
if 'snapshotId' in r_data:
snapshot_id = r_data['snapshotId']
# Waits till volume is available
if wait_to_finish:
salt.utils.cloud.run_func_until_ret_arg(fun=describe_snapshots,
kwargs={'snapshot_id': snapshot_id},
fun_call=call,
argument_being_watched='status',
required_argument_response='completed')
return r_data