mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-01 04:38:12 +00:00
parent
49315adf79
commit
433f620905
@ -359,6 +359,9 @@ class VMware(BaseManager):
|
|||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def execute(self, subcommand, args, timeout=120, log_level=logging.INFO):
|
def execute(self, subcommand, args, timeout=120, log_level=logging.INFO):
|
||||||
|
trial = 2
|
||||||
|
|
||||||
|
while trial:
|
||||||
try:
|
try:
|
||||||
return (yield from self._execute(subcommand, args, timeout=timeout, log_level=log_level))
|
return (yield from self._execute(subcommand, args, timeout=timeout, log_level=log_level))
|
||||||
except VMwareError as e:
|
except VMwareError as e:
|
||||||
@ -367,7 +370,10 @@ class VMware(BaseManager):
|
|||||||
self._host_type = "player"
|
self._host_type = "player"
|
||||||
return (yield from self._execute(subcommand, args, timeout=timeout, log_level=log_level))
|
return (yield from self._execute(subcommand, args, timeout=timeout, log_level=log_level))
|
||||||
else:
|
else:
|
||||||
|
if trial <= 0:
|
||||||
raise e
|
raise e
|
||||||
|
trial -= 1
|
||||||
|
yield from asyncio.sleep(0.5)
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def _execute(self, subcommand, args, timeout=120, log_level=logging.INFO):
|
def _execute(self, subcommand, args, timeout=120, log_level=logging.INFO):
|
||||||
|
Loading…
Reference in New Issue
Block a user