Skip to content

Commit

Permalink
remove py2 dep on certificate error
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Jun 22, 2024
1 parent 6766043 commit 1163c31
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions plugins/module_utils/srlinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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}")
Expand Down

0 comments on commit 1163c31

Please sign in to comment.