Skip to content

Commit

Permalink
Fix linting in monitors library (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek-j16 authored Sep 30, 2024
1 parent 8335a1e commit 8ade8fd
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions actions/lib/monitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@ def _run(self, **kwargs):

class DatadogGetAllMonitors(DatadogBaseAction):
def _run(self, **kwargs):
monitor_tags_raw = kwargs.pop("tags","")
group_states_raw = kwargs.pop("group_states","")
monitor_tags = [tag.strip() for tag in monitor_tags_raw.split(",")] if monitor_tags_raw else None
group_states = [state.strip() for state in group_states_raw] if group_states_raw else None
return api.Monitor.get_all(monitor_tags=monitor_tags, group_states=group_states, **kwargs)
monitor_tags_raw = kwargs.pop("tags", "")
group_states_raw = kwargs.pop("group_states", "")
monitor_tags = (
[tag.strip() for tag in monitor_tags_raw.split(",")]
if monitor_tags_raw
else None
)
group_states = (
[state.strip() for state in group_states_raw] if group_states_raw else None
)
return api.Monitor.get_all(
monitor_tags=monitor_tags, group_states=group_states, **kwargs
)


class DatadogGetMonitor(DatadogBaseAction):
Expand Down

0 comments on commit 8ade8fd

Please sign in to comment.