Merge pull request #7230 from binarytemple/fix_for_issue_7228
fix issue #7228 ec2_vol crash
This commit is contained in:
commit
ce48e1f9ff
1 changed files with 3 additions and 3 deletions
|
@ -278,15 +278,15 @@ def attach_volume(module, ec2, volume, instance):
|
||||||
# Use password data attribute to tell whether the instance is Windows or Linux
|
# Use password data attribute to tell whether the instance is Windows or Linux
|
||||||
if device_name is None and instance:
|
if device_name is None and instance:
|
||||||
try:
|
try:
|
||||||
if not ec2.get_password_data(inst.id):
|
if not ec2.get_password_data(instance.id):
|
||||||
device_name = '/dev/sdf'
|
device_name = '/dev/sdf'
|
||||||
attach = volume.attach(inst.id, device_name)
|
attach = volume.attach(instance.id, device_name)
|
||||||
while volume.attachment_state() != 'attached':
|
while volume.attachment_state() != 'attached':
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
volume.update()
|
volume.update()
|
||||||
else:
|
else:
|
||||||
device_name = '/dev/xvdf'
|
device_name = '/dev/xvdf'
|
||||||
attach = volume.attach(inst.id, device_name)
|
attach = volume.attach(instance.id, device_name)
|
||||||
while volume.attachment_state() != 'attached':
|
while volume.attachment_state() != 'attached':
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
volume.update()
|
volume.update()
|
||||||
|
|
Loading…
Reference in a new issue