瀏覽代碼

convert map to list for apprise function call
fix apprise config schema
remove apprise from required dependencies

Pim Kunis 1 年之前
父節點
當前提交
5a989826a1
共有 3 個文件被更改,包括 16 次插入15 次删除
  1. 14 12
      borgmatic/config/schema.yaml
  2. 1 1
      borgmatic/hooks/apprise.py
  3. 1 2
      setup.py

+ 14 - 12
borgmatic/config/schema.yaml

@@ -1308,21 +1308,23 @@ properties:
                     - finish
                     - finish
     apprise:
     apprise:
         type: object
         type: object
-        required: ['service_urls']
+        required: ['services']
         additionalProperties: false
         additionalProperties: false
         properties:
         properties:
             services:
             services:
-                type: object
-                required:
-                    - url
-                    - label
-                properties:
-                    url:
-                        type: string
-                        example: "mastodon://accesskey/host/?visibility=direct"
-                    label:
-                        type: string
-                        example: mastodon
+                type: array
+                items:
+                    type: object
+                    required:
+                        - url
+                        - label
+                    properties:
+                        url:
+                            type: string
+                            example: "mastodon://accesskey/host/?visibility=direct"
+                        label:
+                            type: string
+                            example: mastodon
                 description: |
                 description: |
                     A list of Apprise services to publish to with URLs and labels.
                     A list of Apprise services to publish to with URLs and labels.
                     The labels are used for logging.
                     The labels are used for logging.

+ 1 - 1
borgmatic/hooks/apprise.py

@@ -53,7 +53,7 @@ def ping_monitor(hook_config, config, config_filename, state, monitoring_log_lev
     notify_type = state_to_notify_type[state.name.lower()]
     notify_type = state_to_notify_type[state.name.lower()]
 
 
     apprise_object = apprise.Apprise()
     apprise_object = apprise.Apprise()
-    apprise_object.add(map(lambda service: service['url'], hook_config.get('services')))
+    apprise_object.add(list(map(lambda service: service['url'], hook_config.get('services'))))
 
 
     if dry_run:
     if dry_run:
         return
         return

+ 1 - 2
setup.py

@@ -34,8 +34,7 @@ setup(
         'packaging',
         'packaging',
         'requests',
         'requests',
         'ruamel.yaml>0.15.0,<0.18.0',
         'ruamel.yaml>0.15.0,<0.18.0',
-        'setuptools',
-        'apprise'
+        'setuptools'
     ),
     ),
     extra_require={
     extra_require={
         "Apprise": ["apprise"]
         "Apprise": ["apprise"]