diff --git a/lisa/env.py b/lisa/env.py index 27b0d3dc654b8724187887934113cd7debe087c0..1747d0f76e36ffc5527c4a3dc1e9484465ee6014 100644 --- a/lisa/env.py +++ b/lisa/env.py @@ -125,7 +125,6 @@ class TargetConf(MultiSrcConf, HideExekallID): KeyDesc('port', 'SSH or ADB server port', [int, None]), KeyDesc('device', 'ADB device. Takes precedence over "host"', [str, None]), KeyDesc('keyfile', 'SSH private key file', [str, None]), - KeyDesc('workdir', 'Remote target workdir', [str]), KeyDesc('tools', 'List of tools to install on the target', [StrList]), LevelKeyDesc('ftrace', 'FTrace configuration', ( @@ -146,7 +145,7 @@ class TargetConf(MultiSrcConf, HideExekallID): )) )) - DEFAULT_CONF = { + DEFAULT_SRC = { 'username': USERNAME_DEFAULT, 'ftrace': { 'buffsize': FTRACE_BUFSIZE_DEFAULT, @@ -160,8 +159,6 @@ class TargetConf(MultiSrcConf, HideExekallID): def __init__(self, conf, src='user'): super().__init__(conf=conf, src=src) - # Give some preset in the the lowest prio source - self.add_src('default', self.DEFAULT_CONF, fallback=True) # We do not allow overriding source for this kind of configuration to keep # the YAML interface simple and dict-like diff --git a/lisa/utils.py b/lisa/utils.py index a796649235e7db8974245b3a5975eaf8a5f3d5c9..29645f280e9596f0ab290186e573672d328ca8c2 100644 --- a/lisa/utils.py +++ b/lisa/utils.py @@ -697,8 +697,13 @@ class MultiSrcConf(SerializableConfABC, Loggable, Mapping, metaclass=MultiSrcCon """ pass - def __init__(self, conf=None, src='default'): + DEFAULT_SRC = {} + """ + Source added automatically using :meth:`add_src` under the name 'default' + when instances are built. + """ + def __init__(self, conf=None, src='conf'): self._nested_init( parent=None, structure=self.STRUCTURE, @@ -707,6 +712,10 @@ class MultiSrcConf(SerializableConfABC, Loggable, Mapping, metaclass=MultiSrcCon if conf is not None: self.add_src(src, conf) + # Give some preset in the the lowest prio source + if self.DEFAULT_SRC: + self.add_src('default', self.DEFAULT_SRC, fallback=True) + @classmethod def get_help(cls, *args, **kwargs): return cls.STRUCTURE.get_help(*args, **kwargs)