Skip to content

Commit

Permalink
ignore_error on errata install
Browse files Browse the repository at this point in the history
  • Loading branch information
damoore044 committed Jul 29, 2024
1 parent 36cb87d commit 7fb730e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions airgun/entities/host_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 7fb730e

Please sign in to comment.