From 3fc74d353a6345f145b2f9d58dacc9afbaeb2a69 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 10 Mar 2021 20:32:45 +0100 Subject: [PATCH] run_node: add label to RunNode class this allows specifying a label on each run node that can be used to filter/select specific nodes. Change-Id: Ib6a977007f56d6ff9ff029aaf049a75fb5d5e1dd --- src/osmo_gsm_tester/obj/run_node.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/osmo_gsm_tester/obj/run_node.py b/src/osmo_gsm_tester/obj/run_node.py index 72879a75..676c2629 100644 --- a/src/osmo_gsm_tester/obj/run_node.py +++ b/src/osmo_gsm_tester/obj/run_node.py @@ -30,13 +30,14 @@ class RunNode(log.Origin): T_LOCAL = 'local' T_REM_SSH = 'ssh' - def __init__(self, type=None, run_addr=None, ssh_user=None, ssh_addr=None, run_label=None, ssh_port=None, adb_serial_id=None): + def __init__(self, type=None, run_addr=None, ssh_user=None, ssh_addr=None, run_label=None, label=None, ssh_port=None, adb_serial_id=None): super().__init__(log.C_RUN, 'runnode') self._type = type self._run_addr = run_addr self._ssh_user = ssh_user self._ssh_addr = ssh_addr self._run_label = run_label + self._label = label self._ssh_port = ssh_port self._adb_serial_id = adb_serial_id if not self._type: @@ -57,8 +58,8 @@ class RunNode(log.Origin): def from_conf(cls, conf): return cls(conf.get('run_type', None), conf.get('run_addr', None), conf.get('ssh_user', None), conf.get('ssh_addr', None), - conf.get('run_label', None), conf.get('ssh_port', None), - conf.get('adb_serial_id', None)) + conf.get('run_label', None), conf.get('label', None), + conf.get('ssh_port', None), conf.get('adb_serial_id', None)) @classmethod def schema(cls): @@ -68,6 +69,7 @@ class RunNode(log.Origin): 'ssh_user': schema.STR, 'ssh_addr': schema.IPV4, 'run_label': schema.STR, + 'label': schema.STR, 'ssh_port': schema.STR, 'adb_serial_id': schema.STR, } @@ -94,6 +96,9 @@ class RunNode(log.Origin): def run_label(self): return self._run_label + def label(self): + return self._label + def ssh_port(self): return self._ssh_port