From: Ondrej Lichtner olichtne@redhat.com
These can be useful to retrieve additional information about the host that we are running our tests on even if these parameters weren't directly requested for matching.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com --- lnst/Controller/Host.py | 1 + lnst/Controller/Machine.py | 4 +++- lnst/Controller/SlavePoolManager.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/lnst/Controller/Host.py b/lnst/Controller/Host.py index 89b6b25..a50a7ad 100644 --- a/lnst/Controller/Host.py +++ b/lnst/Controller/Host.py @@ -40,6 +40,7 @@ class Host(Namespace): def __init__(self, machine, **kwargs): super(Host, self).__init__(machine) self.params = Parameters() + self.params._from_dict(self._machine._pool_params) self.params._from_dict(self._machine._slave_desc)
self._machine.set_initns(self) diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py index 4b9afcb..f63fd6f 100644 --- a/lnst/Controller/Machine.py +++ b/lnst/Controller/Machine.py @@ -45,7 +45,7 @@ class Machine(object): """
def __init__(self, m_id, hostname, msg_dispatcher, ctl_config, - libvirt_domain=None, rpcport=None, security=None): + libvirt_domain=None, rpcport=None, security=None, pool_params=None): self._id = m_id self._hostname = hostname self._mapped = False @@ -59,6 +59,8 @@ def __init__(self, m_id, hostname, msg_dispatcher, ctl_config, self._security["privkey"] = ctl_config.get_option("security", "privkey")
+ self._pool_params = pool_params + self._domain_ctl = None self._network_bridges = None self._libvirt_domain = libvirt_domain diff --git a/lnst/Controller/SlavePoolManager.py b/lnst/Controller/SlavePoolManager.py index 3456332..fc863c1 100644 --- a/lnst/Controller/SlavePoolManager.py +++ b/lnst/Controller/SlavePoolManager.py @@ -73,7 +73,7 @@ def __init__(self, pools, msg_dispatcher, ctl_config, pool_checks=True):
pool[m_id] = Machine(m_id, hostname, self._msg_dispatcher, ctl_config, libvirt_domain, rpc_port, - m_spec["security"]) + m_spec["security"], params) pool[m_id].init_connection() #TODO check if all described devices are available
Wed, Sep 23, 2020 at 05:20:45PM CEST, olichtne@redhat.com wrote:
From: Ondrej Lichtner olichtne@redhat.com
These can be useful to retrieve additional information about the host that we are running our tests on even if these parameters weren't directly requested for matching.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com
lnst/Controller/Host.py | 1 + lnst/Controller/Machine.py | 4 +++- lnst/Controller/SlavePoolManager.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/lnst/Controller/Host.py b/lnst/Controller/Host.py index 89b6b25..a50a7ad 100644 --- a/lnst/Controller/Host.py +++ b/lnst/Controller/Host.py @@ -40,6 +40,7 @@ class Host(Namespace): def __init__(self, machine, **kwargs): super(Host, self).__init__(machine) self.params = Parameters()
self.params._from_dict(self._machine._pool_params) self.params._from_dict(self._machine._slave_desc) self._machine.set_initns(self)
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py index 4b9afcb..f63fd6f 100644 --- a/lnst/Controller/Machine.py +++ b/lnst/Controller/Machine.py @@ -45,7 +45,7 @@ class Machine(object): """
def __init__(self, m_id, hostname, msg_dispatcher, ctl_config,
libvirt_domain=None, rpcport=None, security=None):
libvirt_domain=None, rpcport=None, security=None, pool_params=None): self._id = m_id self._hostname = hostname self._mapped = False
@@ -59,6 +59,8 @@ def __init__(self, m_id, hostname, msg_dispatcher, ctl_config, self._security["privkey"] = ctl_config.get_option("security", "privkey")
self._pool_params = pool_params
self._domain_ctl = None self._network_bridges = None self._libvirt_domain = libvirt_domain
diff --git a/lnst/Controller/SlavePoolManager.py b/lnst/Controller/SlavePoolManager.py index 3456332..fc863c1 100644 --- a/lnst/Controller/SlavePoolManager.py +++ b/lnst/Controller/SlavePoolManager.py @@ -73,7 +73,7 @@ def __init__(self, pools, msg_dispatcher, ctl_config, pool_checks=True):
pool[m_id] = Machine(m_id, hostname, self._msg_dispatcher, ctl_config, libvirt_domain, rpc_port,
m_spec["security"])
m_spec["security"], params) pool[m_id].init_connection() #TODO check if all described devices are available
-- 2.28.0 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedorahos...
Makes sense. I have no objections.
I had just one concern but it's probably not relevant. I thought that once we pass 'params' it will make following Machine object args obsolete: hostname -> can be fetched from params['hostname'] libvirt_domain -> params['libvirt_domain'] rpc_port -> params['rpc_port']
It's likely not a big deal, since these parameters are the most important ones for LNST to work.
Acked-by: Jan Tluka jtluka@redhat.com
On Thu, Sep 24, 2020 at 03:37:07PM +0200, Jan Tluka wrote:
Wed, Sep 23, 2020 at 05:20:45PM CEST, olichtne@redhat.com wrote:
From: Ondrej Lichtner olichtne@redhat.com
These can be useful to retrieve additional information about the host that we are running our tests on even if these parameters weren't directly requested for matching.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com
lnst/Controller/Host.py | 1 + lnst/Controller/Machine.py | 4 +++- lnst/Controller/SlavePoolManager.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/lnst/Controller/Host.py b/lnst/Controller/Host.py index 89b6b25..a50a7ad 100644 --- a/lnst/Controller/Host.py +++ b/lnst/Controller/Host.py @@ -40,6 +40,7 @@ class Host(Namespace): def __init__(self, machine, **kwargs): super(Host, self).__init__(machine) self.params = Parameters()
self.params._from_dict(self._machine._pool_params) self.params._from_dict(self._machine._slave_desc) self._machine.set_initns(self)
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py index 4b9afcb..f63fd6f 100644 --- a/lnst/Controller/Machine.py +++ b/lnst/Controller/Machine.py @@ -45,7 +45,7 @@ class Machine(object): """
def __init__(self, m_id, hostname, msg_dispatcher, ctl_config,
libvirt_domain=None, rpcport=None, security=None):
libvirt_domain=None, rpcport=None, security=None, pool_params=None): self._id = m_id self._hostname = hostname self._mapped = False
@@ -59,6 +59,8 @@ def __init__(self, m_id, hostname, msg_dispatcher, ctl_config, self._security["privkey"] = ctl_config.get_option("security", "privkey")
self._pool_params = pool_params
self._domain_ctl = None self._network_bridges = None self._libvirt_domain = libvirt_domain
diff --git a/lnst/Controller/SlavePoolManager.py b/lnst/Controller/SlavePoolManager.py index 3456332..fc863c1 100644 --- a/lnst/Controller/SlavePoolManager.py +++ b/lnst/Controller/SlavePoolManager.py @@ -73,7 +73,7 @@ def __init__(self, pools, msg_dispatcher, ctl_config, pool_checks=True):
pool[m_id] = Machine(m_id, hostname, self._msg_dispatcher, ctl_config, libvirt_domain, rpc_port,
m_spec["security"])
m_spec["security"], params) pool[m_id].init_connection() #TODO check if all described devices are available
-- 2.28.0 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedorahos...
Makes sense. I have no objections.
I had just one concern but it's probably not relevant. I thought that once we pass 'params' it will make following Machine object args obsolete: hostname -> can be fetched from params['hostname'] libvirt_domain -> params['libvirt_domain'] rpc_port -> params['rpc_port']
It's likely not a big deal, since these parameters are the most important ones for LNST to work.
Acked-by: Jan Tluka jtluka@redhat.com
Yeah, at some point I think the whole Machine class should be refactored to something more sensible IMO, but for now it works so there were always more important things to implement/fix.
Thanks for the review, will be pushing this now.
-Ondrej
lnst-developers@lists.fedorahosted.org