Checks if IOS image exist at startup and not during node creation. Fixes #240.

This commit is contained in:
Jeremy committed 2015-06-29 16:30:57 -06:00
1 parent 3b3929803b
commit be85d95ff7
3 files changed
+9 -13

No files matched your search

+8 -8
View File
@@ -360,14 +360,6 @@ class Dynamips(BaseManager):
return hypervisor
@asyncio.coroutine
def ghost_ios_support(self, vm):
ghost_ios_support = self.config.get_section_config("Dynamips").getboolean("ghost_ios_support", True)
if ghost_ios_support:
with (yield from Dynamips._ghost_ios_lock):
yield from self._set_ghost_ios(vm)
@asyncio.coroutine
def create_nio(self, node, nio_settings):
"""
@@ -437,6 +429,14 @@ class Dynamips(BaseManager):
yield from nio.create()
return nio
@asyncio.coroutine
def ghost_ios_support(self, vm):
ghost_ios_support = self.config.get_section_config("Dynamips").getboolean("ghost_ios_support", True)
if ghost_ios_support:
with (yield from Dynamips._ghost_ios_lock):
yield from self._set_ghost_ios(vm)
@asyncio.coroutine
def _set_ghost_ios(self, vm):
"""
@@ -462,9 +462,6 @@ class Router(BaseVM):
image = self.manager.get_abs_image_path(image)
if not os.path.isfile(image):
raise DynamipsError("IOS image '{}' is not accessible".format(image))
yield from self._hypervisor.send('vm set_ios "{name}" "{image}"'.format(name=self._name, image=image))
log.info('Router "{name}" [{id}]: has a new IOS image set: "{image}"'.format(name=self._name,