From ed10888e2cf93353f23b7697912a02ec014a4bfb Mon Sep 17 00:00:00 2001 From: Shubham Ganar <67952129+shubhamsg199@users.noreply.github.com> Date: Fri, 13 Oct 2023 13:46:25 +0530 Subject: [PATCH] Fix Puppet tests (#12893) Signed-off-by: Shubham Ganar (cherry picked from commit b1150c8af3b437fa300327a65f692141dff8bb5d) --- robottelo/hosts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/robottelo/hosts.py b/robottelo/hosts.py index bb63d79f47e..5d7b48438a6 100644 --- a/robottelo/hosts.py +++ b/robottelo/hosts.py @@ -1862,7 +1862,7 @@ def delete_puppet_class(self, puppetclass_name): for hostgroup in puppet_class.read().hostgroup: hostgroup.delete_puppetclass(data={'puppetclass_id': puppet_class.id}) # Search and remove puppet class from affected hosts - for host in self.api.Host().search(query={'search': f'class={puppet_class.name}'}): + for host in self.api.Host(puppetclass=f'{puppet_class.name}').search(): host.delete_puppetclass(data={'puppetclass_id': puppet_class.id}) # Remove puppet class entity puppet_class.delete()