diff --git a/airgun/entities/contenthost.py b/airgun/entities/contenthost.py index 3886c0119..e28061756 100644 --- a/airgun/entities/contenthost.py +++ b/airgun/entities/contenthost.py @@ -121,7 +121,8 @@ def execute_module_stream_action( def search_package(self, entity_name, package_name): """Search for specific package installed in content host""" - view = self.navigate_to(self, 'Edit', entity_name=entity_name) + view = self.navigate_to(self, 'LegacyDetails', entity_name=entity_name) + view.packages_installed.wait_displayed() view.packages_installed.search(package_name) return view.packages_installed.table.read() @@ -145,7 +146,8 @@ def install_errata(self, entity_name, errata_id, install_via='rex'): :return: Returns a dict containing task status details """ - view = self.navigate_to(self, 'Edit', entity_name=entity_name) + view = self.navigate_to(self, 'LegacyDetails', entity_name=entity_name) + view.errata.wait_displayed() if errata_id == "All": view.errata.select_all.fill(True) else: diff --git a/airgun/entities/errata.py b/airgun/entities/errata.py index dfc13b0c1..bbb579ef2 100644 --- a/airgun/entities/errata.py +++ b/airgun/entities/errata.py @@ -59,11 +59,14 @@ def read( view.content_hosts.environment_filter.fill(environment) return view.read(widget_names=widget_names) - def install(self, entity_name, host_name): + def install(self, entity_name, host_names): """Install errata on content host. :param str entity_name: errata id or title - :param str host_name: content host name to apply errata on + :param str host_names: content host name to apply errata on + pass 'All' for any available hosts, + or pass a list of str hostnames, + or single str hostname. """ view = self.navigate_to( self, @@ -73,8 +76,22 @@ def install(self, entity_name, host_name): installable=False, repo=None, ) - view.content_hosts.search(host_name) - view.content_hosts.table.row(name=host_name)[0].fill(True) + view.content_hosts.wait_displayed() + if host_names == "All": + # clear search to show all hosts, select_all + view.content_hosts.search(" ") + for row in view.content_hosts.table.row(): + row[0].fill(True) + elif isinstance(host_names, list): + # clear search to show all hosts + view.content_hosts.search(" ") + # find and select hostnames from list + for hostname in host_names: + view.content_hosts.table.row(name=hostname)[0].fill(True) + else: + # search and select the single passed hostname + view.content_hosts.search(host_names) + view.content_hosts.table.row(name=host_names)[0].fill(True) view.content_hosts.apply.click() view = ErrataInstallationConfirmationView(view.browser) view.confirm.click()