mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Change IndexError to StopIteration
This commit is contained in:
parent
74067e15e4
commit
ce01b7bbc6
@ -408,7 +408,7 @@ def migrate(name, target=''):
|
||||
origin_data = _find_vm(name, data, quiet=True)
|
||||
try:
|
||||
origin_hyper = origin_data.iterkeys().next()
|
||||
except IndexError:
|
||||
except StopIteration:
|
||||
print('Named vm {0} was not found to migrate'.format(name))
|
||||
return ''
|
||||
disks = origin_data[origin_hyper][name]['disks']
|
||||
|
Loading…
Reference in New Issue
Block a user