From 59126a8ba23253d8f7d416f97d96bc1d198936f7 Mon Sep 17 00:00:00 2001 From: Ladislav Vasina Date: Thu, 15 Aug 2024 11:52:11 +0200 Subject: [PATCH] Simplify manage_via flags --- airgun/entities/all_hosts.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/airgun/entities/all_hosts.py b/airgun/entities/all_hosts.py index baac791f4..62d229523 100644 --- a/airgun/entities/all_hosts.py +++ b/airgun/entities/all_hosts.py @@ -138,7 +138,6 @@ def manage_packages( packages_to_upgrade=None, packages_to_install=None, packages_to_remove=None, - manage_by_rex=False, manage_by_customized_rex=False, ): """ @@ -154,7 +153,6 @@ def manage_packages( packages_to_upgrade (str or list): str with one package or list of packages to upgrade packages_to_install (str or list): str with one package or list of packages to install packages_to_remove (str or list): str with one package or list of packages to remove - manage_by_rex (bool): manage by rex flag manage_by_customized_rex (bool): manage by customized rex flag """ @@ -177,10 +175,6 @@ def manage_packages( raise ValueError( "Exactly one of the options must be selected: packages_to_upgrade, packages_to_install, packages_to_remove!" ) - if sum([manage_by_rex, manage_by_customized_rex]) != 1: - raise ValueError( - "Only one of the options can be selected: manage_by_rex, manage_by_customized_rex!" - ) # Navigate to All Hosts view = self.navigate_to(self, 'All') @@ -242,11 +236,11 @@ def manage_packages( "//*[contains(@class, 'pf-c-dropdown__menu-item') and normalize-space(.)={}]" ) # Select how to manage packages - if manage_by_rex: + if not manage_by_customized_rex: view.review.expander.click() view.review.manage_via_dropdown.item_select('via remote execution') view.review.finish_package_management_btn.click() - elif manage_by_customized_rex: + else: # In this case "Run job" page is opened on which user can specify job details # Here we just select tu run with prefilled values view.review.expander.click()