From da2682236a308444b262b9f3a24b0efd07409b13 Mon Sep 17 00:00:00 2001 From: Peter Ondrejka Date: Mon, 4 Mar 2024 18:59:59 +0100 Subject: [PATCH] forgotten target sat in host cli tests (#14237) (cherry picked from commit 4c61af248aabe09c0ac2ad82c6b07758313f9117) --- tests/foreman/cli/test_host.py | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/tests/foreman/cli/test_host.py b/tests/foreman/cli/test_host.py index dc38931a491..3e1a3d8cd31 100644 --- a/tests/foreman/cli/test_host.py +++ b/tests/foreman/cli/test_host.py @@ -2553,15 +2553,15 @@ def test_positive_host_with_puppet( location=[host_template.location], ).update(['location', 'organization']) - session_puppet_enabled_sat.cli.target_sat.cli.Host.update( + session_puppet_enabled_sat.cli.Host.update( { 'name': host.name, 'puppet-environment': module_puppet_environment.name, } ) - host = session_puppet_enabled_sat.cli.target_sat.cli.Host.info({'id': host['id']}) + host = session_puppet_enabled_sat.cli.Host.info({'id': host['id']}) assert host['puppet-environment'] == module_puppet_environment.name - session_puppet_enabled_sat.cli.target_sat.cli.Host.delete({'id': host['id']}) + session_puppet_enabled_sat.cli.Host.delete({'id': host['id']}) @pytest.fixture @@ -2635,9 +2635,7 @@ class are listed scp_id = choice(sc_params_list)['id'] session_puppet_enabled_sat.cli.SmartClassParameter.update({'id': scp_id, 'override': 1}) # Verify that affected sc-param is listed - host_scparams = session_puppet_enabled_sat.cli.target_sat.cli.Host.sc_params( - {'host': host['name']} - ) + host_scparams = session_puppet_enabled_sat.cli.Host.sc_params({'host': host['name']}) assert scp_id in [scp['id'] for scp in host_scparams] @@ -2672,9 +2670,7 @@ def test_positive_create_with_puppet_class_name( 'puppet-proxy-id': session_puppet_enabled_proxy.id, } ) - host_classes = session_puppet_enabled_sat.cli.target_sat.cli.Host.puppetclasses( - {'host': host['name']} - ) + host_classes = session_puppet_enabled_sat.cli.Host.puppetclasses({'host': host['name']}) assert module_puppet_classes[0].name in [puppet['name'] for puppet in host_classes] @@ -2715,21 +2711,17 @@ def test_positive_update_host_owner_and_verify_puppet_class_name( 'puppet-proxy-id': session_puppet_enabled_proxy.id, } ) - host_classes = session_puppet_enabled_sat.cli.target_sat.cli.Host.puppetclasses( - {'host': host['name']} - ) + host_classes = session_puppet_enabled_sat.cli.Host.puppetclasses({'host': host['name']}) assert module_puppet_classes[0].name in [puppet['name'] for puppet in host_classes] - session_puppet_enabled_sat.cli.target_sat.cli.Host.update( + session_puppet_enabled_sat.cli.Host.update( {'id': host['id'], 'owner': module_puppet_user.login, 'owner-type': 'User'} ) - host = session_puppet_enabled_sat.cli.target_sat.cli.Host.info({'id': host['id']}) + host = session_puppet_enabled_sat.cli.Host.info({'id': host['id']}) assert int(host['additional-info']['owner-id']) == module_puppet_user.id assert host['additional-info']['owner-type'] == 'User' - host_classes = session_puppet_enabled_sat.cli.target_sat.cli.Host.puppetclasses( - {'host': host['name']} - ) + host_classes = session_puppet_enabled_sat.cli.Host.puppetclasses({'host': host['name']}) assert module_puppet_classes[0].name in [puppet['name'] for puppet in host_classes]