From b9ba9e007295f14e227cb6f6a845bbc4c7ce8877 Mon Sep 17 00:00:00 2001 From: GerriorL <84335026+gerriorl@users.noreply.github.com> Date: Mon, 18 Jul 2022 09:57:35 -0400 Subject: [PATCH 1/2] Add timeout parameter --- ...changelog_GerriorL_add_timeout_to_netconf_20220718.rst | 6 ++++++ connector/src/yang/connector/netconf.py | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 connector/docs/changelog/undistributed/changelog_GerriorL_add_timeout_to_netconf_20220718.rst diff --git a/connector/docs/changelog/undistributed/changelog_GerriorL_add_timeout_to_netconf_20220718.rst b/connector/docs/changelog/undistributed/changelog_GerriorL_add_timeout_to_netconf_20220718.rst new file mode 100644 index 00000000..6c76f268 --- /dev/null +++ b/connector/docs/changelog/undistributed/changelog_GerriorL_add_timeout_to_netconf_20220718.rst @@ -0,0 +1,6 @@ +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- +* yang.connector + * Modified netconf.py: + * Add custom timeout parameter to Netconf.connect \ No newline at end of file diff --git a/connector/src/yang/connector/netconf.py b/connector/src/yang/connector/netconf.py index 705d62e1..4b2389a8 100644 --- a/connector/src/yang/connector/netconf.py +++ b/connector/src/yang/connector/netconf.py @@ -295,6 +295,7 @@ def connect(self): port: 830 username: admin password: admin + timeout: 120 Code Example:: @@ -335,6 +336,7 @@ def connect(self): 'hostkey_verify': False, 'look_for_keys': False, 'ssh_config': None, + 'timeout': 60 } defaults.update(self.connection_info) @@ -364,6 +366,12 @@ def connect(self): except Exception: pass + # check timeout + try: + defaults['timeout'] = int(self.connection_info['timeout']) + except (KeyError, ValueError): + pass + # support sshtunnel if 'sshtunnel' in defaults: from unicon.sshutils import sshtunnel From a0187a61997febc2b72488540bed79c445bb7c62 Mon Sep 17 00:00:00 2001 From: Liam Gerrior <84335026+GerriorL@users.noreply.github.com> Date: Wed, 5 Oct 2022 14:48:33 -0400 Subject: [PATCH 2/2] Update __init__.py --- connector/src/yang/connector/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connector/src/yang/connector/__init__.py b/connector/src/yang/connector/__init__.py index 81faa16c..a5810ba1 100644 --- a/connector/src/yang/connector/__init__.py +++ b/connector/src/yang/connector/__init__.py @@ -7,7 +7,7 @@ """ # metadata -__version__ = '22.8' +__version__ = '22.9' __author__ = ( 'Jonathan Yang ', 'Siming Yuan