Skip to content

Commit

Permalink
Host: export pool xml params to the matches Host object
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
olichtne committed Sep 23, 2020
1 parent d84cdd6 commit d3c5048
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions lnst/Controller/Host.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion lnst/Controller/Machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lnst/Controller/SlavePoolManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d3c5048

Please sign in to comment.