lucasheld / ansible-uptime-kuma

Ansible collection of modules to configure Uptime Kuma
GNU General Public License v3.0
135 stars 19 forks source link

maintenance: TypeError: '<' not supported between instances of 'dict' and 'dict' #28

Closed tigattack closed 11 months ago

tigattack commented 11 months ago

Hey, thanks for this collection and the Python library, both have been super useful for me, really appreciate the work.

I've encountered a bug with the maintenance module. The following task causes the error noted in the title:

- name: Set maintenance schedules
  lucasheld.uptime_kuma.maintenance:
    title: Plex Sync
    description: Plex server synchronisation
    strategy: recurring-weekday
    intervalDay: 1
    weekdays: [2, 3, 4, 5, 6, 7, 0]
    timeRange:
      - hours: 7
        minutes: 0
      - hours: 7
        minutes: 30
    monitors:
      - name: Plex Media Server
      - name: Backup Plex Media Server
  tags: maintenance

This seems to be caused by attempting to sort a list of dicts here: maintenance.py#L252

lucasheld commented 11 months ago

Thank you for creating this issue. The problem occurred only when you have defined multiple monitors or status pages in the maintenance.

tigattack commented 10 months ago

Thanks!