Skip to content

Commit

Permalink
Simplify manage_via flags
Browse files Browse the repository at this point in the history
  • Loading branch information
LadislavVasina1 authored and ogajduse committed Aug 15, 2024
1 parent e47e178 commit 59126a8
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions airgun/entities/all_hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
):
"""
Expand All @@ -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
"""

Expand All @@ -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')
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 59126a8

Please sign in to comment.