From 5cd80ddda03fe8a5ab1b948dd3097671993f72f1 Mon Sep 17 00:00:00 2001 From: Greg Campion Date: Thu, 25 Jul 2024 14:10:22 +0200 Subject: [PATCH] build: :arrow_up: update dependencies except connexion connexion update will require more work than I currently have time for. They changed how they validate and their validation libs as well as other sub libraries. --- .../paessler/prtg/plugins/module_utils/prtg_api.py | 12 +++++++----- .../paessler/prtg/plugins/modules/device_resume.py | 8 ++++---- .../resume/tasks/resume_one_ok_with_api_key.yml | 4 ++-- requirements.txt | 12 ++++++------ 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/ansible_collections/paessler/prtg/plugins/module_utils/prtg_api.py b/ansible_collections/paessler/prtg/plugins/module_utils/prtg_api.py index 92b3790..f4dfded 100644 --- a/ansible_collections/paessler/prtg/plugins/module_utils/prtg_api.py +++ b/ansible_collections/paessler/prtg/plugins/module_utils/prtg_api.py @@ -68,7 +68,7 @@ class PRTG_API: except (HTTPError, URLError) as e: raise PRTG_API_Exception( f"PRTG API not available at '{self.appserver_url}' - {e}" - ) + ) from e def device_filter_request_body(self, message=None, duration=None): body = {"filter": f'dnsname = "{self.params["host"]}"'} @@ -98,13 +98,15 @@ class PRTG_API: except HTTPError as e: if e.status == 404: msg = ( - "Couldn't find PRTG device with IPv4 Address/DNS Name '{0}'. " - "Check that the name in your inventory matches the name of the device in PRTG." - ).format(self.params["host"]) + f"Couldn't find PRTG device with the IP Address / \ + DNS Name '{self.params['host']}'. " + "Check that the host name exactly matches the name \ + of the device in PRTG including capitalization." + ) else: msg = f"Couldn't perform PRTG action. PRTG returned: {e}" - raise PRTG_API_Exception(msg) + raise PRTG_API_Exception(msg) from e def device_pause(self): pause_body = self.device_filter_request_body( diff --git a/ansible_collections/paessler/prtg/plugins/modules/device_resume.py b/ansible_collections/paessler/prtg/plugins/modules/device_resume.py index d234bd2..683d6a9 100644 --- a/ansible_collections/paessler/prtg/plugins/modules/device_resume.py +++ b/ansible_collections/paessler/prtg/plugins/modules/device_resume.py @@ -68,8 +68,8 @@ object: type: dict sample: changed: True - resume_success: 1 - resume_failed: 0 + resumed_success: 1 + resumed_failed: 0 """ from ansible.module_utils.basic import AnsibleModule @@ -124,8 +124,8 @@ def run_module(): if summary > 0: if success > 0: ansible_result["changed"] = True - ansible_result["resume_success"] = success - ansible_result["resume_failed"] = failed + ansible_result["resumed_success"] = success + ansible_result["resumed_failed"] = failed # in the event of a successful module execution, you will want to # simple AnsibleModule.exit_json(), passing the key/value results diff --git a/ansible_collections/paessler/prtg/tests/integration/targets/resume/tasks/resume_one_ok_with_api_key.yml b/ansible_collections/paessler/prtg/tests/integration/targets/resume/tasks/resume_one_ok_with_api_key.yml index b73d21d..704cbdd 100644 --- a/ansible_collections/paessler/prtg/tests/integration/targets/resume/tasks/resume_one_ok_with_api_key.yml +++ b/ansible_collections/paessler/prtg/tests/integration/targets/resume/tasks/resume_one_ok_with_api_key.yml @@ -19,8 +19,8 @@ that: - result is changed - result is not failed - - result.resume_success == 1 - - result.resume_failed == 0 + - result.resumed_success == 1 + - result.resumed_failed == 0 # TODO paused_success and paused_failed should not be in result # - not "paused_success" in result # - not "paused_failed" in result diff --git a/requirements.txt b/requirements.txt index 7df8d66..98a5006 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ -ansible-core==2.15.4 -ansible-lint==6.20.1 -ansible==8.4.0 -black==23.9.1 +ansible-core==2.15.11 +ansible-lint==6.22.2 +ansible==10.2.0 +black==24.4.2 connexion==2.14.2 -openapi-spec-validator==0.6.0 +openapi-spec-validator==0.7.1 pylama==8.4.1 -pytest==7.4.2 +pytest==8.3.2 -- GitLab