From b3e0f7df1ebbb0748d267172ef315aa22ae3903a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20B=C5=99ezina?= Date: Thu, 11 Jul 2024 12:47:32 +0200 Subject: [PATCH] feat: update pytest-mh output to work with latest version --- src/mrack/outputs/pytest_mh.py | 7 ++++--- tests/unit/test_pytest_mh.py | 12 ++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/mrack/outputs/pytest_mh.py b/src/mrack/outputs/pytest_mh.py index 849dcbc8..a580add5 100644 --- a/src/mrack/outputs/pytest_mh.py +++ b/src/mrack/outputs/pytest_mh.py @@ -67,7 +67,8 @@ def create_mh_config(self): "family": get_os_type(host), }, "role": host["role"], - "ssh": { + "conn": { + "type": "ssh", "host": get_external_id(provisioned_host, host, self._config), }, } @@ -75,11 +76,11 @@ def create_mh_config(self): if get_os_type(host) == "windows": username = get_username(provisioned_host, host, self._config) if username: - hostcfg["ssh"]["username"] = username + hostcfg["conn"]["username"] = username password = get_password(provisioned_host, host, self._config) if password: - hostcfg["ssh"]["password"] = password + hostcfg["conn"]["password"] = password cfgdom["hosts"].append(merge_dict(hostcfg, host.get("pytest_mh", {}))) diff --git a/tests/unit/test_pytest_mh.py b/tests/unit/test_pytest_mh.py index c6f5eeed..4125a8a7 100644 --- a/tests/unit/test_pytest_mh.py +++ b/tests/unit/test_pytest_mh.py @@ -39,7 +39,8 @@ def mock_metadata(): role: ipa os: fedora-37 pytest_mh: - ssh: + conn: + type: ssh username: tuser password: tuserpassword config: @@ -77,7 +78,8 @@ def test_output(self, mock_metadata, mock_gethostbyaddr): os: family: linux role: client - ssh: + conn: + type: ssh host: 192.168.0.1 artifacts: - /etc/sssd/* @@ -87,7 +89,8 @@ def test_output(self, mock_metadata, mock_gethostbyaddr): os: family: linux role: ipa - ssh: + conn: + type: ssh host: 192.168.0.1 username: tuser password: tuserpassword @@ -100,7 +103,8 @@ def test_output(self, mock_metadata, mock_gethostbyaddr): os: family: windows role: ad - ssh: + conn: + type: ssh host: 192.168.0.1 username: Administrator password: adpassword