Skip to content

Commit

Permalink
fix: ImportError in maintenance module
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasheld committed Jan 10, 2023
1 parent 8479b11 commit c8075be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/modules/maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
get_docker_host_by_name, get_monitor_by_name

try:
from uptime_kuma_api import UptimeKumaApi, MaintenanceType
from uptime_kuma_api import UptimeKumaApi
HAS_UPTIME_KUMA_API = True
except ImportError:
HAS_UPTIME_KUMA_API = False
Expand All @@ -169,7 +169,7 @@ def get_status_page_by(api, key, value):
def run(api, params, result):
if not params["dateRange"]:
params["dateRange"] = [
datetime.date.today().strftime("%Y-%m-%d 00:00")
datetime.date.today().strftime("%Y-%m-%d 00:00:00")
]

if not params["timeRange"]:
Expand Down Expand Up @@ -216,8 +216,8 @@ def run(api, params, result):
api.edit_maintenance(maintenance["id"], **options)
result["changed"] = True
if maintenance:
monitors = params["monitors"]
status_pages = params["status_pages"]
monitors = params["monitors"] or []
status_pages = params["status_pages"] or []

# add id or name to monitor
for monitor in monitors:
Expand Down

0 comments on commit c8075be

Please sign in to comment.