From 1163c318eb5cb467362b3d55b6f13b0c753baa5d Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Sun, 23 Jun 2024 00:49:15 +0300 Subject: [PATCH] remove py2 dep on certificate error --- plugins/module_utils/srlinux.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plugins/module_utils/srlinux.py b/plugins/module_utils/srlinux.py index 239c171..29ae140 100644 --- a/plugins/module_utils/srlinux.py +++ b/plugins/module_utils/srlinux.py @@ -2,7 +2,7 @@ # Licensed under the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause -""" srlinux module utils """ +"""srlinux module utils""" # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function @@ -13,7 +13,6 @@ from ansible.module_utils._text import to_text from ansible.module_utils.connection import Connection -from ansible.module_utils.urls import CertificateError class JSONRPCClient: @@ -47,10 +46,7 @@ def _httpapi_error_handle(self, method="POST", path="/jsonrpc", payload=None): self.module.fail_json( msg=f"connection error occurred: {e}", ) - except CertificateError as e: - self.module.fail_json( - msg=f"certificate error occurred: {e}", - ) + except ValueError as e: try: self.module.fail_json(msg=f"certificate not found: {e}")