Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #8161 from john-dupuy/fix-alert-evaluation
Browse files Browse the repository at this point in the history
[1LP][RFR] Fix alert creation by adding an extra condition for the default driving event
  • Loading branch information
izapolsk committed Nov 16, 2018
2 parents 60af5b4 + 0c0e904 commit 93e78c2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cfme/control/explorer/alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,17 +300,18 @@ def create(self, description, severity=None, active=None, based_on=None, evaluat
timeline_event=True, mgmt_event=None):
""" Create a new alert in the UI.
Note: Since alerts in CFME require a description, driving_event, and one
Note: Since alerts in CFME require a description, driving_event or evaluate, and one
of snmp_trap, emails, timeline_event, or mgmt_event, we set defaults to
timeline_event=True, and driving_event=<first_item_from_dropdown>
We select the first item from the dropdown for efficiency.
The driving event is only selected if evaluate is None.
This allows creation of an alert only by a description. e.g.
>>> alert = appliance.collections.alerts.create('my_alert_description')
>>> alert.delete()
"""
view = navigate_to(self,"Add")
if driving_event is None:
if driving_event is None and evaluate is None:
driving_event = view.driving_event.all_options[1].text
# instantiate the alert
alert = self.instantiate(description, severity=severity, active=active, based_on=based_on,
Expand Down

0 comments on commit 93e78c2

Please sign in to comment.