diff --git a/airgun/entities/host_new.py b/airgun/entities/host_new.py index 667420e6d..7f162ba92 100644 --- a/airgun/entities/host_new.py +++ b/airgun/entities/host_new.py @@ -434,27 +434,32 @@ def get_errata_type_counts(self, entity_name): errata_counts[type] = view.content.errata.table.row_count return errata_counts - def apply_erratas(self, entity_name, search=None): + def apply_erratas(self, entity_name, search=None, ignore_error=False): """Apply available errata on selected host based on searchbar result. param: search (string): search value to filter results. - example: search="errata_id == {ERRATA_ID}" - default: None; all available errata are returned and installed. + example: search="errata_id == {ERRATA_ID}", only the errata(s) matching search are applied. + default: None, all available errata in table are applied. + + param: ignore_error (bool): if install task(s) fail, should we continue? + if True: skip assert_no_error() check + default: False, flash error after 'apply' will raise exception """ view = self.navigate_to(self, 'NewDetails', entity_name=entity_name) view.wait_displayed() + view.content.errata.select() if search is None: # Return all errata, clear the searchbar view.content.errata.searchbar.clear() else: - # Return only errata by search + # Return only errata(s) by search view.content.errata.searchbar.fill(search) # wait for filter to apply view.content.errata.wait_displayed() - self.browser.plugin.ensure_page_safe() view.content.errata.select_all.click() view.content.errata.apply.fill('Apply') - view.flash.assert_no_error() + if not ignore_error: + view.flash.assert_no_error() view.flash.dismiss() # clear the searchbar so any input will not persist view.content.errata.searchbar.clear()