mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Prevent orphaned volumes
This commit is contained in:
parent
6079a96e6e
commit
19fce03ee2
1 changed files with 15 additions and 0 deletions
|
@ -3741,6 +3741,21 @@ def attach_volume(name=None, kwargs=None, instance_id=None, call=None):
|
|||
provider=get_provider(),
|
||||
opts=__opts__,
|
||||
sigver='4')
|
||||
while data[0]:
|
||||
log.warn(
|
||||
('Error attaching volume {0} '
|
||||
'to instance {1}. Retrying!').format(kwargs['volume_id'],
|
||||
instance_id))
|
||||
# Instance isn't running yet, so cannot attach this volume to it
|
||||
# wait for instance to run and try again
|
||||
time.sleep(10)
|
||||
data = aws.query(params,
|
||||
return_url=True,
|
||||
location=get_location(),
|
||||
provider=get_provider(),
|
||||
opts=__opts__,
|
||||
sigver='4')
|
||||
|
||||
return data
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue