mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
cloudinit: Fixed broken testsuite
Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
This commit is contained in:
parent
0e5b1b3048
commit
dadaf8eb45
@ -58,7 +58,7 @@ def _run_iso_commands(iso, tempdir, cloudinit=False):
|
|||||||
log.debug("cmd output: %s", output)
|
log.debug("cmd output: %s", output)
|
||||||
|
|
||||||
|
|
||||||
def _perform_generic_injections(injections, scratchdir, media, cb, cloudinit=False):
|
def _perform_generic_injections(injections, scratchdir, media, cb, **kwargs):
|
||||||
if not injections:
|
if not injections:
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -76,17 +76,17 @@ def _perform_generic_injections(injections, scratchdir, media, cb, cloudinit=Fal
|
|||||||
filename, dst, media)
|
filename, dst, media)
|
||||||
shutil.copy(filename, os.path.join(tempdir, dst))
|
shutil.copy(filename, os.path.join(tempdir, dst))
|
||||||
|
|
||||||
return cb(media, tempdir, cloudinit)
|
return cb(media, tempdir, **kwargs)
|
||||||
finally:
|
finally:
|
||||||
shutil.rmtree(tempdir)
|
shutil.rmtree(tempdir)
|
||||||
|
|
||||||
|
|
||||||
def perform_initrd_injections(initrd, injections, scratchdir, cloudinit=False):
|
def perform_initrd_injections(initrd, injections, scratchdir):
|
||||||
"""
|
"""
|
||||||
Insert files into the root directory of the initial ram disk
|
Insert files into the root directory of the initial ram disk
|
||||||
"""
|
"""
|
||||||
_perform_generic_injections(injections, scratchdir, initrd,
|
_perform_generic_injections(injections, scratchdir, initrd,
|
||||||
_run_initrd_commands, cloudinit)
|
_run_initrd_commands)
|
||||||
|
|
||||||
|
|
||||||
def perform_cdrom_injections(injections, scratchdir, cloudinit=False):
|
def perform_cdrom_injections(injections, scratchdir, cloudinit=False):
|
||||||
@ -100,7 +100,7 @@ def perform_cdrom_injections(injections, scratchdir, cloudinit=False):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
_perform_generic_injections(injections, scratchdir, iso,
|
_perform_generic_injections(injections, scratchdir, iso,
|
||||||
_run_iso_commands, cloudinit)
|
_run_iso_commands, cloudinit=cloudinit)
|
||||||
except Exception: # pragma: no cover
|
except Exception: # pragma: no cover
|
||||||
os.unlink(iso)
|
os.unlink(iso)
|
||||||
raise
|
raise
|
||||||
|
Loading…
Reference in New Issue
Block a user