Merge pull request #27244 from garethgreenaway/ec2_create_snapshot_no_return_data_exception

Exception in cloud.ec2.create_snapshot
This commit is contained in:
Mike Place 2015-09-18 15:41:11 -06:00
commit 51a0193b54

View File

@ -3760,15 +3760,17 @@ def create_snapshot(kwargs=None, call=None, wait_to_finish=False):
for d in data:
for k, v in d.items():
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