Unverified Commit e4f0f6e3 authored by Jakob Görgen's avatar Jakob Görgen Committed by GitHub
Browse files

orchestration: absolue path check images (#102)

ExpEnv hd_path and hd_path_raw use absolute path unmodified if given as param
parent 8134c8c2
......@@ -66,11 +66,25 @@ class ExpEnv(object):
def hdcopy_path(self, sim: 'simulators.Simulator') -> str:
return f'{self.workdir}/hdcopy.{sim.name}'
def hd_path(self, hd_name: str) -> str:
return f'{self.repodir}/images/output-{hd_name}/{hd_name}'
@staticmethod
def is_absolute_exists(path: str) -> bool:
return os.path.isabs(path) and os.path.isfile(path)
def hd_path(self, hd_name_or_path: str) -> str:
if ExpEnv.is_absolute_exists(hd_name_or_path):
return hd_name_or_path
return (
f'{self.repodir}/images/output-{hd_name_or_path}/'
f'{hd_name_or_path}'
)
def hd_raw_path(self, hd_name: str) -> str:
return f'{self.repodir}/images/output-{hd_name}/{hd_name}.raw'
def hd_raw_path(self, hd_name_or_path: str) -> str:
if ExpEnv.is_absolute_exists(hd_name_or_path):
return f'{hd_name_or_path}.raw'
return (
f'{self.repodir}/images/output-{hd_name_or_path}/'
f'{hd_name_or_path}.raw'
)
def cfgtar_path(self, sim: 'simulators.Simulator') -> str:
return f'{self.workdir}/cfg.{sim.name}.tar'
......
......@@ -87,7 +87,7 @@ class NodeConfig():
self.memory = 512
"""Amount of system memory in MB."""
self.disk_image = 'base'
"""Name of disk image to use."""
"""Name of disk image to use or absolute path to image."""
self.mtu = 1500
"""Networking MTU."""
self.nockp = 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment