From aedb3f2532f67dc0cd94a4c53f0e5def69b64c82 Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Wed, 23 Mar 2022 14:51:59 -0700
Subject: [PATCH 01/29] New performance graphs
---
tests/performance/graphs/netmiko_arista_eos.svg | 6 +++---
tests/performance/graphs/netmiko_cisco_asa.svg | 6 +++---
tests/performance/graphs/netmiko_cisco_ios.svg | 6 +++---
tests/performance/graphs/netmiko_cisco_nxos.svg | 6 +++---
tests/performance/graphs/netmiko_cisco_xe.svg | 6 +++---
tests/performance/graphs/netmiko_cisco_xr.svg | 6 +++---
tests/performance/graphs/netmiko_hp_procurve.svg | 6 +++---
tests/performance/graphs/netmiko_juniper_junos.svg | 6 +++---
8 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/tests/performance/graphs/netmiko_arista_eos.svg b/tests/performance/graphs/netmiko_arista_eos.svg
index 4ac71b343..1698ebec0 100644
--- a/tests/performance/graphs/netmiko_arista_eos.svg
+++ b/tests/performance/graphs/netmiko_arista_eos.svg
@@ -1,4 +1,4 @@
-Netmiko: Arista EOS Performance (vEOS) 0 0 10 10 20 20 30 30 40 40 50 50 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0a4 Netmiko: Arista EOS Performance (vEOS) 5.600851 11.669230769230769 455.2731705209025 2.4.2 6.21565 108.91282051282049 449.9118166153846 3.0.0 6.25804 206.15641025641023 449.54215467375025 3.1.0 8.236209 303.4 432.2915343996048 3.2.0 1.904317 400.64358974358964 487.50879061426554 3.3.3 2.280802 497.88717948717954 484.22565364572966 3.4.0 1.845722 595.1307692307691 488.01976823799913 4.0.0a4 6.615937 11.669230769230769 446.42111433581357 2.4.2 6.971088 108.91282051282049 443.32402048741994 3.0.0 6.7046 206.15641025641023 445.6479287559331 3.1.0 8.897231 303.4 426.52709288077796 3.2.0 2.497181 400.64358974358964 482.3387208486333 3.3.3 2.81286 497.88717948717954 479.5858425265476 3.4.0 2.855799 595.1307692307691 479.2113930311043 4.0.0a4 8.651368 11.669230769230769 428.6711408627564 2.4.2 7.130959 108.91282051282049 441.92986563318453 3.0.0 7.223195 206.15641025641023 441.1255217113022 3.1.0 17.371332 303.4 352.6287057784849 3.2.0 3.357669 400.64358974358964 474.83483632791797 3.3.3 2.930811 497.88717948717954 478.55725097953837 3.4.0 2.429823 595.1307692307691 482.92611620283503 4.0.0a4 17.739594 11.669230769230769 349.417277471097 2.4.2 34.856952 108.91282051282049 200.14537858146457 3.0.0 34.630821 206.15641025641023 202.11735368228398 3.1.0 56.674599 303.4 9.884615384615415 3.2.0 32.008313 400.64358974358964 224.98693139475876 3.3.3 30.11219 497.88717948717954 241.52206962919348 3.4.0 18.554945 595.1307692307691 342.30701010205786 4.0.0a4 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Arista EOS Performance (vEOS) 0 0 10 10 20 20 30 30 40 40 50 50 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0 Netmiko: Arista EOS Performance (vEOS) 5.600851 11.669230769230769 455.2731705209025 2.4.2 6.21565 108.91282051282049 449.9118166153846 3.0.0 6.25804 206.15641025641023 449.54215467375025 3.1.0 8.236209 303.4 432.2915343996048 3.2.0 1.904317 400.64358974358964 487.50879061426554 3.3.3 2.280802 497.88717948717954 484.22565364572966 3.4.0 1.687836 595.1307692307691 489.39661290223347 4.0.0 6.615937 11.669230769230769 446.42111433581357 2.4.2 6.971088 108.91282051282049 443.32402048741994 3.0.0 6.7046 206.15641025641023 445.6479287559331 3.1.0 8.897231 303.4 426.52709288077796 3.2.0 2.497181 400.64358974358964 482.3387208486333 3.3.3 2.81286 497.88717948717954 479.5858425265476 3.4.0 2.167681 595.1307692307691 485.21212518381947 4.0.0 8.651368 11.669230769230769 428.6711408627564 2.4.2 7.130959 108.91282051282049 441.92986563318453 3.0.0 7.223195 206.15641025641023 441.1255217113022 3.1.0 17.371332 303.4 352.6287057784849 3.2.0 3.357669 400.64358974358964 474.83483632791797 3.3.3 2.930811 497.88717948717954 478.55725097953837 3.4.0 3.117634 595.1307692307691 476.92806124323334 4.0.0 17.739594 11.669230769230769 349.417277471097 2.4.2 34.856952 108.91282051282049 200.14537858146457 3.0.0 34.630821 206.15641025641023 202.11735368228398 3.1.0 56.674599 303.4 9.884615384615415 3.2.0 32.008313 400.64358974358964 224.98693139475876 3.3.3 30.11219 497.88717948717954 241.52206962919348 3.4.0 21.231472 595.1307692307691 318.96635976808864 4.0.0 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_cisco_asa.svg b/tests/performance/graphs/netmiko_cisco_asa.svg
index 085d84e58..4b19fe369 100644
--- a/tests/performance/graphs/netmiko_cisco_asa.svg
+++ b/tests/performance/graphs/netmiko_cisco_asa.svg
@@ -1,4 +1,4 @@
-Netmiko: Cisco ASA Performance 0 0 4 4 8 8 12 12 16 16 20 20 24 24 28 28 32 32 36 36 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0a4 Netmiko: Cisco ASA Performance 20.615055 11.669230769230769 240.09855604353214 2.4.2 18.416279 108.91282051282049 268.2582609902278 3.0.0 18.258663 206.15641025641023 270.27684771978943 3.1.0 18.131249 303.4 271.90863770025044 3.2.0 4.741192 400.64358974358964 443.3949802560347 3.3.3 4.767506 497.88717948717954 443.0579770888329 3.4.0 4.641249 595.1307692307691 444.67494938044194 4.0.0a4 21.104976 11.669230769230769 233.8241420935936 2.4.2 19.348867 108.91282051282049 256.31461465388935 3.0.0 18.908106 206.15641025641023 261.9594369150067 3.1.0 19.274312 303.4 257.2694398849729 3.2.0 4.579358 400.64358974358964 445.46758687460044 3.3.3 4.783185 497.88717948717954 442.85717627335225 3.4.0 4.920887 595.1307692307691 441.0936279671265 4.0.0a4 31.040221 11.669230769230769 106.5835465199047 2.4.2 27.323944 108.91282051282049 154.1778734637095 3.0.0 27.182697 206.15641025641023 155.98682255384233 3.1.0 27.334803 303.4 154.03880234595294 3.2.0 5.075321 400.64358974358964 439.11579308365583 3.3.3 5.082772 497.88717948717954 439.02036819200805 3.4.0 5.718624 595.1307692307691 430.8770172050197 4.0.0a4 36.460483 11.669230769230769 37.166298626628304 2.4.2 38.590701 108.91282051282049 9.884615384615358 3.0.0 37.98234 206.15641025641023 17.675889375725376 3.1.0 37.721248 303.4 21.019692329706402 3.2.0 10.911831 400.64358974358964 364.36766070526045 3.3.3 10.640835 497.88717948717954 367.8383041003742 3.4.0 10.172494 595.1307692307691 373.8363431795894 4.0.0a4 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Cisco ASA Performance 0 0 4 4 8 8 12 12 16 16 20 20 24 24 28 28 32 32 36 36 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0 Netmiko: Cisco ASA Performance 20.615055 11.669230769230769 240.09855604353214 2.4.2 18.416279 108.91282051282049 268.2582609902278 3.0.0 18.258663 206.15641025641023 270.27684771978943 3.1.0 18.131249 303.4 271.90863770025044 3.2.0 4.741192 400.64358974358964 443.3949802560347 3.3.3 4.767506 497.88717948717954 443.0579770888329 3.4.0 5.193105 595.1307692307691 437.6073344287307 4.0.0 21.104976 11.669230769230769 233.8241420935936 2.4.2 19.348867 108.91282051282049 256.31461465388935 3.0.0 18.908106 206.15641025641023 261.9594369150067 3.1.0 19.274312 303.4 257.2694398849729 3.2.0 4.579358 400.64358974358964 445.46758687460044 3.3.3 4.783185 497.88717948717954 442.85717627335225 3.4.0 4.57251 595.1307692307691 445.5552891505372 4.0.0 31.040221 11.669230769230769 106.5835465199047 2.4.2 27.323944 108.91282051282049 154.1778734637095 3.0.0 27.182697 206.15641025641023 155.98682255384233 3.1.0 27.334803 303.4 154.03880234595294 3.2.0 5.075321 400.64358974358964 439.11579308365583 3.3.3 5.082772 497.88717948717954 439.02036819200805 3.4.0 5.568892 595.1307692307691 432.7946336157312 4.0.0 36.460483 11.669230769230769 37.166298626628304 2.4.2 38.590701 108.91282051282049 9.884615384615358 3.0.0 37.98234 206.15641025641023 17.675889375725376 3.1.0 37.721248 303.4 21.019692329706402 3.2.0 10.911831 400.64358974358964 364.36766070526045 3.3.3 10.640835 497.88717948717954 367.8383041003742 3.4.0 9.710037 595.1307692307691 379.75902592241266 4.0.0 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_cisco_ios.svg b/tests/performance/graphs/netmiko_cisco_ios.svg
index 433fbce9b..aace099fb 100644
--- a/tests/performance/graphs/netmiko_cisco_ios.svg
+++ b/tests/performance/graphs/netmiko_cisco_ios.svg
@@ -1,4 +1,4 @@
-Netmiko: Cisco IOS Performance (Cisco 881) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 4.0.0a4 Netmiko: Cisco IOS Performance (Cisco 881) 5.015699 11.669230769230769 369.8405610719277 2.4.2 5.692225 128.36153846153843 351.7293448142215 3.0.0 7.7883 245.05384615384614 295.6155108782434 3.1.0 7.71581 361.7461538461538 297.55613410118104 3.2.0 3.047461 478.4384615384615 422.5320822620004 3.3.3 3.069351 595.1307692307691 421.94606705507385 4.0.0a4 5.437302 11.669230769230769 358.5538653530674 2.4.2 6.039594 128.36153846153843 342.4299607843052 3.0.0 8.142923 245.05384615384614 286.1219306714863 3.1.0 8.145355 361.7461538461538 286.0568238198077 3.2.0 3.134423 478.4384615384615 420.20403043811984 3.3.3 3.094754 595.1307692307691 421.26600564339935 4.0.0a4 7.712221 11.669230769230769 297.652214895044 2.4.2 5.965445 128.36153846153843 344.41499694594967 3.0.0 8.065553 245.05384615384614 288.19319593233183 3.1.0 8.06323 361.7461538461538 288.255384754885 3.2.0 3.140944 478.4384615384615 420.0294573378746 3.3.3 3.118014 595.1307692307691 420.6433142905848 4.0.0a4 12.729495 11.669230769230769 163.33522716927052 2.4.2 16.356528 128.36153846153843 66.23625530885886 3.0.0 18.461486 245.05384615384614 9.884615384615415 3.1.0 18.446518 361.7461538461538 10.285322356624306 3.2.0 5.528239 478.4384615384615 356.11939916429264 3.3.3 6.244 595.1307692307691 336.95782627598965 4.0.0a4 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Cisco IOS Performance (Cisco 881) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 4.0.0 Netmiko: Cisco IOS Performance (Cisco 881) 5.015699 11.669230769230769 369.8405610719277 2.4.2 5.692225 128.36153846153843 351.7293448142215 3.0.0 7.7883 245.05384615384614 295.6155108782434 3.1.0 7.71581 361.7461538461538 297.55613410118104 3.2.0 3.047461 478.4384615384615 422.5320822620004 3.3.3 3.050436 595.1307692307691 422.4524388065136 4.0.0 5.437302 11.669230769230769 358.5538653530674 2.4.2 6.039594 128.36153846153843 342.4299607843052 3.0.0 8.142923 245.05384615384614 286.1219306714863 3.1.0 8.145355 361.7461538461538 286.0568238198077 3.2.0 3.134423 478.4384615384615 420.20403043811984 3.3.3 3.110452 595.1307692307691 420.845755907523 4.0.0 7.712221 11.669230769230769 297.652214895044 2.4.2 5.965445 128.36153846153843 344.41499694594967 3.0.0 8.065553 245.05384615384614 288.19319593233183 3.1.0 8.06323 361.7461538461538 288.255384754885 3.2.0 3.140944 478.4384615384615 420.0294573378746 3.3.3 3.111018 595.1307692307691 420.8306035727985 4.0.0 12.729495 11.669230769230769 163.33522716927052 2.4.2 16.356528 128.36153846153843 66.23625530885886 3.0.0 18.461486 245.05384615384614 9.884615384615415 3.1.0 18.446518 361.7461538461538 10.285322356624306 3.2.0 5.528239 478.4384615384615 356.11939916429264 3.3.3 6.266658 595.1307692307691 336.3512510106383 4.0.0 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_cisco_nxos.svg b/tests/performance/graphs/netmiko_cisco_nxos.svg
index c9a43e8cb..9999a33ca 100644
--- a/tests/performance/graphs/netmiko_cisco_nxos.svg
+++ b/tests/performance/graphs/netmiko_cisco_nxos.svg
@@ -1,4 +1,4 @@
-Netmiko: Cisco NX-OS Performance (nx9k virtual) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 22 22 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0a4 Netmiko: Cisco NX-OS Performance (nx9k virtual) 4.987734 11.669230769230769 395.87900728014154 2.4.2 5.704003 108.91282051282049 380.3356038513425 3.0.0 7.65255 206.15641025641023 338.0511379300533 3.1.0 7.812037 303.4 334.5901885065142 3.2.0 7.945623 400.64358974358964 331.69130402255706 3.3.3 7.719243 497.88717948717954 336.6038657391908 3.4.0 5.139839 595.1307692307691 392.5782510299932 4.0.0a4 5.36276 11.669230769230769 387.74075138146554 2.4.2 6.289166 108.91282051282049 367.6372676388214 3.0.0 8.914154 206.15641025641023 310.67368624725464 3.1.0 8.36903 303.4 322.5031556933993 3.2.0 7.960268 400.64358974358964 331.3735000366038 3.3.3 8.21612 497.88717948717954 325.8213808550322 3.4.0 5.17345 595.1307692307691 391.8488751493599 4.0.0a4 7.674167 11.669230769230769 337.58203798028535 2.4.2 5.935209 108.91282051282049 375.3183154678457 3.0.0 7.975704 206.15641025641023 331.0385309463221 3.1.0 8.20709 303.4 326.0173364708163 3.2.0 8.498077 400.64358974358964 319.70276982960206 3.3.3 8.309425 497.88717948717954 323.7966146611525 3.4.0 5.690468 595.1307692307691 380.6293202699071 4.0.0a4 15.172741 11.669230769230769 174.8591492014845 2.4.2 17.162782 108.91282051282049 131.6742422700795 3.0.0 21.243036 206.15641025641023 43.13064480324687 3.1.0 21.62422 303.4 34.85875715684125 3.2.0 22.775075 400.64358974358964 9.884615384615358 3.3.3 22.034908 497.88717948717954 25.946617629140633 3.4.0 21.206284 595.1307692307691 43.92818198943701 4.0.0a4 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Cisco NX-OS Performance (nx9k virtual) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 22 22 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0 Netmiko: Cisco NX-OS Performance (nx9k virtual) 4.987734 11.669230769230769 397.11574056421085 2.4.2 5.704003 108.91282051282049 381.7499395722393 3.0.0 7.65255 206.15641025641023 339.9486255051735 3.1.0 7.812037 303.4 336.5272216711299 3.2.0 7.945623 400.64358974358964 333.6614604957705 3.3.3 7.719243 497.88717948717954 338.5178901731159 3.4.0 5.363876 595.1307692307691 389.0465331620726 4.0.0 5.36276 11.669230769230769 389.0704742148154 2.4.2 6.289166 108.91282051282049 369.19669741619873 3.0.0 8.914154 206.15641025641023 312.88399476633754 3.1.0 8.36903 303.4 324.5782980238393 3.2.0 7.960268 400.64358974358964 333.3472878099116 3.3.3 8.21612 497.88717948717954 327.85860839561633 3.4.0 4.947016 595.1307692307691 397.9892457484239 4.0.0 7.674167 11.669230769230769 339.48488559734074 2.4.2 5.935209 108.91282051282049 376.7899798585706 3.0.0 7.975704 206.15641025641023 333.0161461520819 3.1.0 8.20709 303.4 328.05232497829337 3.2.0 8.498077 400.64358974358964 321.8099100011677 3.3.3 8.309425 497.88717948717954 325.8569776374013 3.4.0 5.532515 595.1307692307691 385.428795533493 4.0.0 15.172741 11.669230769230769 178.6213052838384 2.4.2 17.162782 108.91282051282049 135.92983884893187 3.0.0 21.243036 206.15641025641023 48.39796051733316 3.1.0 21.62422 303.4 40.22058932672786 3.2.0 22.775075 400.64358974358964 15.531807736828796 3.3.3 22.034908 497.88717948717954 31.41028191737354 3.4.0 23.038316 595.1307692307691 9.884615384615415 4.0.0 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_cisco_xe.svg b/tests/performance/graphs/netmiko_cisco_xe.svg
index 64d0f1209..ebad1ca5f 100644
--- a/tests/performance/graphs/netmiko_cisco_xe.svg
+++ b/tests/performance/graphs/netmiko_cisco_xe.svg
@@ -1,4 +1,4 @@
-Netmiko: Cisco IOS-XE Performance (Cisco C1111-4P) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0a4 Netmiko: Cisco IOS-XE Performance (Cisco C1111-4P) 4.824338 11.669230769230769 375.7904172898143 2.4.2 5.340213 108.91282051282049 362.06840143622384 3.0.0 7.53684 206.15641025641023 303.63922669733415 3.1.0 7.527892 303.4 303.8772390023653 3.2.0 3.070582 400.64358974358964 422.43944590203483 3.3.3 3.067946 497.88717948717954 422.50956217785756 3.4.0 2.897018 595.1307692307691 427.0561611133022 4.0.0a4 5.343782 11.669230769230769 361.9734678290875 2.4.2 5.961108 108.91282051282049 345.5529063387389 3.0.0 7.961087 206.15641025641023 292.3544696150213 3.1.0 7.963046 303.4 292.30236119911194 3.2.0 3.149141 400.64358974358964 420.3498159656312 3.3.3 2.977177 497.88717948717954 424.92397198064805 3.4.0 3.136093 595.1307692307691 420.69688621105433 4.0.0a4 7.53803 11.669230769230769 303.60757329512285 2.4.2 5.810182 108.91282051282049 349.5674621220566 3.0.0 7.810232 206.15641025641023 296.36713683400524 3.1.0 7.80769 303.4 296.4347527570483 3.2.0 3.024375 400.64358974358964 423.6685288902526 3.3.3 3.222384 497.88717948717954 418.40158895877005 3.4.0 3.218576 595.1307692307691 418.5028798458463 4.0.0a4 15.060866 11.669230769230769 103.50391474225512 2.4.2 16.613027 108.91282051282049 62.21721186011371 3.0.0 18.580455 206.15641025641023 9.884615384615415 3.1.0 18.531863 303.4 11.17713817474413 3.2.0 8.902653 400.64358974358964 267.3092870045018 3.3.3 10.138406 497.88717948717954 234.43887797688484 3.4.0 11.184475 595.1307692307691 206.6139680627594 4.0.0a4 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Cisco IOS-XE Performance (Cisco C1111-4P) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0 Netmiko: Cisco IOS-XE Performance (Cisco C1111-4P) 4.824338 11.669230769230769 375.7904172898143 2.4.2 5.340213 108.91282051282049 362.06840143622384 3.0.0 7.53684 206.15641025641023 303.63922669733415 3.1.0 7.527892 303.4 303.8772390023653 3.2.0 3.070582 400.64358974358964 422.43944590203483 3.3.3 3.067946 497.88717948717954 422.50956217785756 3.4.0 3.077292 595.1307692307691 422.2609632727591 4.0.0 5.343782 11.669230769230769 361.9734678290875 2.4.2 5.961108 108.91282051282049 345.5529063387389 3.0.0 7.961087 206.15641025641023 292.3544696150213 3.1.0 7.963046 303.4 292.30236119911194 3.2.0 3.149141 400.64358974358964 420.3498159656312 3.3.3 2.977177 497.88717948717954 424.92397198064805 3.4.0 2.965434 595.1307692307691 425.23632988162933 4.0.0 7.53803 11.669230769230769 303.60757329512285 2.4.2 5.810182 108.91282051282049 349.5674621220566 3.0.0 7.810232 206.15641025641023 296.36713683400524 3.1.0 7.80769 303.4 296.4347527570483 3.2.0 3.024375 400.64358974358964 423.6685288902526 3.3.3 3.222384 497.88717948717954 418.40158895877005 3.4.0 3.015565 595.1307692307691 423.9028704646071 4.0.0 15.060866 11.669230769230769 103.50391474225512 2.4.2 16.613027 108.91282051282049 62.21721186011371 3.0.0 18.580455 206.15641025641023 9.884615384615415 3.1.0 18.531863 303.4 11.17713817474413 3.2.0 8.902653 400.64358974358964 267.3092870045018 3.3.3 10.138406 497.88717948717954 234.43887797688484 3.4.0 10.685372 595.1307692307691 219.88985714165364 4.0.0 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_cisco_xr.svg b/tests/performance/graphs/netmiko_cisco_xr.svg
index c5692b297..2c2a1d29d 100644
--- a/tests/performance/graphs/netmiko_cisco_xr.svg
+++ b/tests/performance/graphs/netmiko_cisco_xr.svg
@@ -1,4 +1,4 @@
-Netmiko: Cisco IOS-XR Performance (cisco IOS-XRv 9000) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0a4 Netmiko: Cisco IOS-XR Performance (cisco IOS-XRv 9000) 5.733791 11.669230769230769 363.8521727326825 2.4.2 6.266681 108.91282051282049 350.8163186214718 3.0.0 6.264205 206.15641025641023 350.8768879224145 3.1.0 6.273295 303.4 350.654523243267 3.2.0 8.140628 400.64358974358964 304.9747758938149 3.3.3 8.07315 497.88717948717954 306.6254605824304 3.4.0 1.825557 595.1307692307691 459.4575852126945 4.0.0a4 6.0824 11.669230769230769 355.3243038181691 2.4.2 6.900057 108.91282051282049 335.32231960940135 3.0.0 6.999404 206.15641025641023 332.8920375654777 3.1.0 6.88443 303.4 335.70459604955954 3.2.0 8.500045 400.64358974358964 296.18251562042076 3.3.3 8.433702 497.88717948717954 297.805435302344 3.4.0 2.395446 595.1307692307691 445.51664080843886 4.0.0a4 13.662819 11.669230769230769 169.88784191073972 2.4.2 11.732624 108.91282051282049 217.10535476740517 3.0.0 12.024759 206.15641025641023 209.9589845206778 3.1.0 11.881486 303.4 213.46380901743225 3.2.0 9.143244 400.64358974358964 280.4482208720175 3.3.3 9.295759 497.88717948717954 276.71731338684924 3.4.0 2.922008 595.1307692307691 432.63558578299774 4.0.0a4 18.556989 11.669230769230769 50.16390992578181 2.4.2 19.812287 108.91282051282049 19.456106074903346 3.0.0 19.590199 206.15641025641023 24.88894731390309 3.1.0 20.203558 303.4 9.884615384615358 3.2.0 16.494184 400.64358974358964 100.6254029916604 3.3.3 17.251342 497.88717948717954 82.10337925855214 3.4.0 11.205408 595.1307692307691 230.0024083077157 4.0.0a4 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Cisco IOS-XR Performance (cisco IOS-XRv 9000) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0 Netmiko: Cisco IOS-XR Performance (cisco IOS-XRv 9000) 5.733791 11.669230769230769 363.8521727326825 2.4.2 6.266681 108.91282051282049 350.8163186214718 3.0.0 6.264205 206.15641025641023 350.8768879224145 3.1.0 6.273295 303.4 350.654523243267 3.2.0 8.140628 400.64358974358964 304.9747758938149 3.3.3 8.07315 497.88717948717954 306.6254605824304 3.4.0 2.767007 595.1307692307691 436.4273071947183 4.0.0 6.0824 11.669230769230769 355.3243038181691 2.4.2 6.900057 108.91282051282049 335.32231960940135 3.0.0 6.999404 206.15641025641023 332.8920375654777 3.1.0 6.88443 303.4 335.70459604955954 3.2.0 8.500045 400.64358974358964 296.18251562042076 3.3.3 8.433702 497.88717948717954 297.805435302344 3.4.0 2.512359 595.1307692307691 442.65664941865117 4.0.0 13.662819 11.669230769230769 169.88784191073972 2.4.2 11.732624 108.91282051282049 217.10535476740517 3.0.0 12.024759 206.15641025641023 209.9589845206778 3.1.0 11.881486 303.4 213.46380901743225 3.2.0 9.143244 400.64358974358964 280.4482208720175 3.3.3 9.295759 497.88717948717954 276.71731338684924 3.4.0 3.235152 595.1307692307691 424.97528159301294 4.0.0 18.556989 11.669230769230769 50.16390992578181 2.4.2 19.812287 108.91282051282049 19.456106074903346 3.0.0 19.590199 206.15641025641023 24.88894731390309 3.1.0 20.203558 303.4 9.884615384615358 3.2.0 16.494184 400.64358974358964 100.6254029916604 3.3.3 17.251342 497.88717948717954 82.10337925855214 3.4.0 11.773506 595.1307692307691 216.10527635014358 4.0.0 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_hp_procurve.svg b/tests/performance/graphs/netmiko_hp_procurve.svg
index 1eec9431b..8a13168fb 100644
--- a/tests/performance/graphs/netmiko_hp_procurve.svg
+++ b/tests/performance/graphs/netmiko_hp_procurve.svg
@@ -1,4 +1,4 @@
-Netmiko: HPE ProCurve Performance 0 0 10 10 20 20 30 30 40 40 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0a4 Netmiko: HPE ProCurve Performance 11.258269 11.669230769230769 373.59571295030594 2.4.2 17.901763 108.91282051282049 296.57617685741997 3.0.0 18.419321 206.15641025641023 290.57600931588803 3.1.0 18.353988 303.4 291.3334296359119 3.2.0 18.020695 400.64358974358964 295.19737114666003 3.3.3 18.010017 497.88717948717954 295.32116362790555 3.4.0 2.184035 595.1307692307691 478.7953704013842 4.0.0a4 21.831155 11.669230769230769 251.0218422005214 2.4.2 22.221532 108.91282051282049 246.49611290185226 3.0.0 22.93706 206.15641025641023 238.20083414921538 3.1.0 22.718488 303.4 240.73478902941758 3.2.0 22.391657 400.64358974358964 244.52381510527078 3.3.3 22.410676 497.88717948717954 244.3033235150096 3.4.0 2.524702 595.1307692307691 474.84594043243186 4.0.0a4 32.216741 11.669230769230769 130.61938292641474 2.4.2 30.53423 108.91282051282049 150.12511540561582 3.0.0 31.002139 206.15641025641023 144.70054000693466 3.1.0 30.893432 303.4 145.96080496842166 3.2.0 30.752905 400.64358974358964 147.58996642300042 3.3.3 30.529921 497.88717948717954 150.17507062210643 3.4.0 2.561778 595.1307692307691 474.41610993658435 4.0.0a4 42.488945 11.669230769230769 11.531386951482148 2.4.2 42.045111 108.91282051282049 16.67685540260902 3.0.0 42.630991 206.15641025641023 9.884615384615415 3.1.0 42.584148 303.4 10.427676931626536 3.2.0 42.227986 400.64358974358964 14.556743957789934 3.3.3 42.211889 497.88717948717954 14.743360137843297 3.4.0 10.813657 595.1307692307691 378.7502009322821 4.0.0a4 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: HPE ProCurve Performance 0 0 10 10 20 20 30 30 40 40 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0a4 Netmiko: HPE ProCurve Performance 11.258269 11.669230769230769 373.59571295030594 2.4.2 17.901763 108.91282051282049 296.57617685741997 3.0.0 18.419321 206.15641025641023 290.57600931588803 3.1.0 18.353988 303.4 291.3334296359119 3.2.0 18.020695 400.64358974358964 295.19737114666003 3.3.3 18.010017 497.88717948717954 295.32116362790555 3.4.0 2.184035 595.1307692307691 478.7953704013842 4.0.0a4 21.831155 11.669230769230769 251.0218422005214 2.4.2 22.221532 108.91282051282049 246.49611290185226 3.0.0 22.93706 206.15641025641023 238.20083414921538 3.1.0 22.718488 303.4 240.73478902941758 3.2.0 22.391657 400.64358974358964 244.52381510527078 3.3.3 22.410676 497.88717948717954 244.3033235150096 3.4.0 2.524702 595.1307692307691 474.84594043243186 4.0.0a4 32.216741 11.669230769230769 130.61938292641474 2.4.2 30.53423 108.91282051282049 150.12511540561582 3.0.0 31.002139 206.15641025641023 144.70054000693466 3.1.0 30.893432 303.4 145.96080496842166 3.2.0 30.752905 400.64358974358964 147.58996642300042 3.3.3 30.529921 497.88717948717954 150.17507062210643 3.4.0 2.561778 595.1307692307691 474.41610993658435 4.0.0a4 42.488945 11.669230769230769 11.531386951482148 2.4.2 42.045111 108.91282051282049 16.67685540260902 3.0.0 42.630991 206.15641025641023 9.884615384615415 3.1.0 42.584148 303.4 10.427676931626536 3.2.0 42.227986 400.64358974358964 14.556743957789934 3.3.3 42.211889 497.88717948717954 14.743360137843297 3.4.0 10.813657 595.1307692307691 378.7502009322821 4.0.0a4 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_juniper_junos.svg b/tests/performance/graphs/netmiko_juniper_junos.svg
index 438892120..0886e674a 100644
--- a/tests/performance/graphs/netmiko_juniper_junos.svg
+++ b/tests/performance/graphs/netmiko_juniper_junos.svg
@@ -1,4 +1,4 @@
-Netmiko: Juniper Junos Performance 0 0 4 4 8 8 12 12 16 16 20 20 24 24 28 28 32 32 36 36 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0a4 Netmiko: Juniper Junos Performance 6.955827 11.669230769230769 413.13380793339843 2.4.2 8.245966 108.91282051282049 396.2589086067014 3.0.0 7.763991 206.15641025641023 402.5630972274506 3.1.0 7.762834 303.4 402.5782306809165 3.2.0 3.517362 400.64358974358964 458.10861352672697 3.3.3 3.991287 497.88717948717954 451.90971816475053 3.4.0 5.8278 595.1307692307691 427.8882972270296 4.0.0a4 7.795193 11.669230769230769 402.1549779404656 2.4.2 8.638104 108.91282051282049 391.1297796739489 3.0.0 8.640627 206.15641025641023 391.0967790662615 3.1.0 8.832251 303.4 388.590354790599 3.2.0 4.262974 400.64358974358964 448.3560772211217 3.3.3 4.1622 497.88717948717954 449.6741918620624 3.4.0 6.318494 595.1307692307691 421.4700648891077 4.0.0a4 20.183726 11.669230769230769 240.1141070106945 2.4.2 18.754187 108.91282051282049 258.8123455017309 3.0.0 18.747711 206.15641025641023 258.89705098543436 3.1.0 18.852219 303.4 257.53009596831254 3.2.0 14.697604 400.64358974358964 311.87207762004573 3.3.3 16.79162 497.88717948717954 284.48254115266286 3.4.0 19.309357 595.1307692307691 251.55077302062426 4.0.0a4 35.183576 11.669230769230769 43.91745016553557 2.4.2 37.204469 108.91282051282049 17.484355805139785 3.0.0 37.257378 206.15641025641023 16.792310956889935 3.1.0 37.785493 303.4 9.884615384615415 3.2.0 29.58927 400.64358974358964 117.09045753353024 3.3.3 27.660851 497.88717948717954 142.3140004887387 3.4.0 30.160754 595.1307692307691 109.61549943458266 4.0.0a4 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Juniper Junos Performance 0 0 4 4 8 8 12 12 16 16 20 20 24 24 28 28 32 32 36 36 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0 Netmiko: Juniper Junos Performance 6.955827 11.669230769230769 413.13380793339843 2.4.2 8.245966 108.91282051282049 396.2589086067014 3.0.0 7.763991 206.15641025641023 402.5630972274506 3.1.0 7.762834 303.4 402.5782306809165 3.2.0 3.517362 400.64358974358964 458.10861352672697 3.3.3 3.991287 497.88717948717954 451.90971816475053 3.4.0 5.92602 595.1307692307691 426.60358867092197 4.0.0 7.795193 11.669230769230769 402.1549779404656 2.4.2 8.638104 108.91282051282049 391.1297796739489 3.0.0 8.640627 206.15641025641023 391.0967790662615 3.1.0 8.832251 303.4 388.590354790599 3.2.0 4.262974 400.64358974358964 448.3560772211217 3.3.3 4.1622 497.88717948717954 449.6741918620624 3.4.0 6.641656 595.1307692307691 417.24313568518926 4.0.0 20.183726 11.669230769230769 240.1141070106945 2.4.2 18.754187 108.91282051282049 258.8123455017309 3.0.0 18.747711 206.15641025641023 258.89705098543436 3.1.0 18.852219 303.4 257.53009596831254 3.2.0 14.697604 400.64358974358964 311.87207762004573 3.3.3 16.79162 497.88717948717954 284.48254115266286 3.4.0 17.185611 595.1307692307691 279.3291751505308 4.0.0 35.183576 11.669230769230769 43.91745016553557 2.4.2 37.204469 108.91282051282049 17.484355805139785 3.0.0 37.257378 206.15641025641023 16.792310956889935 3.1.0 37.785493 303.4 9.884615384615415 3.2.0 29.58927 400.64358974358964 117.09045753353024 3.3.3 27.660851 497.88717948717954 142.3140004887387 3.4.0 32.165569 595.1307692307691 83.39270383375816 4.0.0 Connect Show Command Simple Config Large ACL
\ No newline at end of file
From b22a6e49005ab70ea7ed6be6b0aabab2c56e1d3f Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Wed, 23 Mar 2022 21:04:33 -0700
Subject: [PATCH 02/29] Fixing HP Procurve session_preparation issue on
repeated connection
---
netmiko/__init__.py | 2 +-
netmiko/hp/hp_procurve.py | 27 ++++++++++++++++++++++-----
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/netmiko/__init__.py b/netmiko/__init__.py
index 76928a7a1..c96ba4774 100644
--- a/netmiko/__init__.py
+++ b/netmiko/__init__.py
@@ -31,7 +31,7 @@
# Alternate naming
Netmiko = ConnectHandler
-__version__ = "4.0.0"
+__version__ = "4.0.1"
__all__ = (
"ConnectHandler",
"ConnLogOnly",
diff --git a/netmiko/hp/hp_procurve.py b/netmiko/hp/hp_procurve.py
index 0588298d0..fce90cff0 100644
--- a/netmiko/hp/hp_procurve.py
+++ b/netmiko/hp/hp_procurve.py
@@ -19,13 +19,30 @@ def session_preparation(self) -> None:
# HP output contains VT100 escape codes
self.ansi_escape_codes = True
- # Procurve over SSH uses 'Press any key to continue'
- data = self._test_channel_read(pattern=r"(any key to continue|[>#])")
- if "any key to continue" in data:
- self.write_channel(self.RETURN)
- self._test_channel_read(pattern=r"[>#]")
+ # ProCurve has an odd behavior where the router prompt can show up
+ # before the 'Press any key to continue' message. Read up until the
+ # Copyright banner to get past this.
+ try:
+ self.read_until_pattern(pattern=r".*opyright", read_timeout=1.3)
+ except ReadTimeout:
+ pass
+
+ # Procurve uses 'Press any key to continue'
+ try:
+ data = self.read_until_pattern(
+ pattern=r"(any key to continue|[>#])", read_timeout=3.0
+ )
+ if "any key to continue" in data:
+ self.write_channel(self.RETURN)
+ self.read_until_pattern(pattern=r"[>#]", read_timeout=3.0)
+ except ReadTimeout:
+ pass
self.set_base_prompt()
+ # If prompt still looks odd, try one more time
+ if len(self.base_prompt) >= 25:
+ self.set_base_prompt()
+
self.set_terminal_width(command="terminal width 511", pattern="terminal")
command = self.RETURN + "no page"
self.disable_paging(command=command)
From cf70089074d4568ad27f3980963e45a5b976adaf Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Wed, 23 Mar 2022 21:26:34 -0700
Subject: [PATCH 03/29] HP performance graphs (#2704)
* Updates graphs for HP ProCurve
* Minor updates to performance test scripts
---
netmiko/__init__.py | 2 +-
.../performance/graphs/netmiko_hp_procurve.svg | 8 +++++++-
tests/performance/netmiko_performance.csv | 18 +++++++++---------
tests/performance/performance_report.md | 10 +++++-----
tests/performance/requirements.txt | 3 +++
tests/performance/test_netmiko.py | 8 ++++++--
6 files changed, 31 insertions(+), 18 deletions(-)
create mode 100644 tests/performance/requirements.txt
diff --git a/netmiko/__init__.py b/netmiko/__init__.py
index c96ba4774..fb0f3a505 100644
--- a/netmiko/__init__.py
+++ b/netmiko/__init__.py
@@ -31,7 +31,7 @@
# Alternate naming
Netmiko = ConnectHandler
-__version__ = "4.0.1"
+__version__ = "4.0.1a1"
__all__ = (
"ConnectHandler",
"ConnLogOnly",
diff --git a/tests/performance/graphs/netmiko_hp_procurve.svg b/tests/performance/graphs/netmiko_hp_procurve.svg
index 8a13168fb..47f7a251d 100644
--- a/tests/performance/graphs/netmiko_hp_procurve.svg
+++ b/tests/performance/graphs/netmiko_hp_procurve.svg
@@ -1,4 +1,10 @@
+<<<<<<< Updated upstream
Netmiko: HPE ProCurve Performance 0 0 10 10 20 20 30 30 40 40 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0a4 Netmiko: HPE ProCurve Performance 11.258269 11.669230769230769 373.59571295030594 2.4.2 17.901763 108.91282051282049 296.57617685741997 3.0.0 18.419321 206.15641025641023 290.57600931588803 3.1.0 18.353988 303.4 291.3334296359119 3.2.0 18.020695 400.64358974358964 295.19737114666003 3.3.3 18.010017 497.88717948717954 295.32116362790555 3.4.0 2.184035 595.1307692307691 478.7953704013842 4.0.0a4 21.831155 11.669230769230769 251.0218422005214 2.4.2 22.221532 108.91282051282049 246.49611290185226 3.0.0 22.93706 206.15641025641023 238.20083414921538 3.1.0 22.718488 303.4 240.73478902941758 3.2.0 22.391657 400.64358974358964 244.52381510527078 3.3.3 22.410676 497.88717948717954 244.3033235150096 3.4.0 2.524702 595.1307692307691 474.84594043243186 4.0.0a4 32.216741 11.669230769230769 130.61938292641474 2.4.2 30.53423 108.91282051282049 150.12511540561582 3.0.0 31.002139 206.15641025641023 144.70054000693466 3.1.0 30.893432 303.4 145.96080496842166 3.2.0 30.752905 400.64358974358964 147.58996642300042 3.3.3 30.529921 497.88717948717954 150.17507062210643 3.4.0 2.561778 595.1307692307691 474.41610993658435 4.0.0a4 42.488945 11.669230769230769 11.531386951482148 2.4.2 42.045111 108.91282051282049 16.67685540260902 3.0.0 42.630991 206.15641025641023 9.884615384615415 3.1.0 42.584148 303.4 10.427676931626536 3.2.0 42.227986 400.64358974358964 14.556743957789934 3.3.3 42.211889 497.88717948717954 14.743360137843297 3.4.0 10.813657 595.1307692307691 378.7502009322821 4.0.0a4 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 text.no_data{text-anchor:middle}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .guide.line{fill:none}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .centered{text-anchor:middle}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .title{text-anchor:middle}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .legends .legend text{fill-opacity:1}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .axis.x text{text-anchor:middle}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .axis.x:not(.web) text[transform]{text-anchor:start}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .axis.x:not(.web) text[transform].backwards{text-anchor:end}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .axis.y text{text-anchor:end}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .axis.y text[transform].backwards{text-anchor:start}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .axis.y2 text{text-anchor:start}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .axis.y2 text[transform].backwards{text-anchor:end}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .axis .guide.line{stroke-dasharray:4,4;stroke:black}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .axis .major.guide.line{stroke-dasharray:6,6;stroke:black}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .horizontal .axis.y .guide.line,#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .horizontal .axis.y2 .guide.line,#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .vertical .axis.x .guide.line{opacity:0}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .horizontal .axis.always_show .guide.line,#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .vertical .axis.always_show .guide.line{opacity:1 !important}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .axis.y .guides:hover .guide.line,#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .axis.y2 .guides:hover .guide.line,#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .axis.x .guides:hover .guide.line{opacity:1}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .axis .guides:hover text{opacity:1}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .nofill{fill:none}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .subtle-fill{fill-opacity:.2}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .dot{stroke-width:1px;fill-opacity:1;stroke-opacity:1}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .dot.active{stroke-width:5px}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .dot.negative{fill:transparent}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 text,#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 tspan{stroke:none !important}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .series text.active{opacity:1}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .tooltip rect{fill-opacity:.95;stroke-width:.5}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .tooltip text{fill-opacity:1}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .showable{visibility:hidden}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .showable.shown{visibility:visible}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .gauge-background{fill:rgba(229,229,229,1);stroke:none}#chart-c6c1ac2e-3dd3-4680-9cad-78c785c16ca9 .bg-lines{stroke:rgba(249,249,249,1);stroke-width:2px}Netmiko: HPE ProCurve Performance 0 0 10 10 20 20 30 30 40 40 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0a4 Netmiko: HPE ProCurve Performance 11.258269 11.669230769230769 373.59571295030594 2.4.2 17.901763 108.91282051282049 296.57617685741997 3.0.0 18.419321 206.15641025641023 290.57600931588803 3.1.0 18.353988 303.4 291.3334296359119 3.2.0 18.020695 400.64358974358964 295.19737114666003 3.3.3 18.010017 497.88717948717954 295.32116362790555 3.4.0 2.184035 595.1307692307691 478.7953704013842 4.0.0a4 21.831155 11.669230769230769 251.0218422005214 2.4.2 22.221532 108.91282051282049 246.49611290185226 3.0.0 22.93706 206.15641025641023 238.20083414921538 3.1.0 22.718488 303.4 240.73478902941758 3.2.0 22.391657 400.64358974358964 244.52381510527078 3.3.3 22.410676 497.88717948717954 244.3033235150096 3.4.0 2.524702 595.1307692307691 474.84594043243186 4.0.0a4 32.216741 11.669230769230769 130.61938292641474 2.4.2 30.53423 108.91282051282049 150.12511540561582 3.0.0 31.002139 206.15641025641023 144.70054000693466 3.1.0 30.893432 303.4 145.96080496842166 3.2.0 30.752905 400.64358974358964 147.58996642300042 3.3.3 30.529921 497.88717948717954 150.17507062210643 3.4.0 2.561778 595.1307692307691 474.41610993658435 4.0.0a4 42.488945 11.669230769230769 11.531386951482148 2.4.2 42.045111 108.91282051282049 16.67685540260902 3.0.0 42.630991 206.15641025641023 9.884615384615415 3.1.0 42.584148 303.4 10.427676931626536 3.2.0 42.227986 400.64358974358964 14.556743957789934 3.3.3 42.211889 497.88717948717954 14.743360137843297 3.4.0 10.813657 595.1307692307691 378.7502009322821 4.0.0a4 Connect Show Command Simple Config Large ACL
+=======
+Netmiko: HPE ProCurve Performance 0 0 10 10 20 20 30 30 40 40 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.1a1 Netmiko: HPE ProCurve Performance 11.258269 11.669230769230769 373.59571295030594 2.4.2 17.901763 108.91282051282049 296.57617685741997 3.0.0 18.419321 206.15641025641023 290.57600931588803 3.1.0 18.353988 303.4 291.3334296359119 3.2.0 18.020695 400.64358974358964 295.19737114666003 3.3.3 18.010017 497.88717948717954 295.32116362790555 3.4.0 1.971205 595.1307692307691 481.26275697035663 4.0.1a1 21.831155 11.669230769230769 251.0218422005214 2.4.2 22.221532 108.91282051282049 246.49611290185226 3.0.0 22.93706 206.15641025641023 238.20083414921538 3.1.0 22.718488 303.4 240.73478902941758 3.2.0 22.391657 400.64358974358964 244.52381510527078 3.3.3 22.410676 497.88717948717954 244.3033235150096 3.4.0 2.301713 595.1307692307691 477.4311025976745 4.0.1a1 32.216741 11.669230769230769 130.61938292641474 2.4.2 30.53423 108.91282051282049 150.12511540561582 3.0.0 31.002139 206.15641025641023 144.70054000693466 3.1.0 30.893432 303.4 145.96080496842166 3.2.0 30.752905 400.64358974358964 147.58996642300042 3.3.3 30.529921 497.88717948717954 150.17507062210643 3.4.0 2.163165 595.1307692307691 479.0373210554013 4.0.1a1 42.488945 11.669230769230769 11.531386951482148 2.4.2 42.045111 108.91282051282049 16.67685540260902 3.0.0 42.630991 206.15641025641023 9.884615384615415 3.1.0 42.584148 303.4 10.427676931626536 3.2.0 42.227986 400.64358974358964 14.556743957789934 3.3.3 42.211889 497.88717948717954 14.743360137843297 3.4.0 10.581683 595.1307692307691 381.43952824492976 4.0.1a1 Connect Show Command Simple Config Large ACL
+>>>>>>> Stashed changes
diff --git a/tests/performance/netmiko_performance.csv b/tests/performance/netmiko_performance.csv
index 71f1b9f31..ee62f729f 100644
--- a/tests/performance/netmiko_performance.csv
+++ b/tests/performance/netmiko_performance.csv
@@ -46,18 +46,18 @@ date,netmiko_version,device_name,connect,send_command_simple,send_config_simple,
2021-9-5 2:57:50,3.2.0,arista1,0:00:08.236209,0:00:08.897231,0:00:17.371332,0:00:56.674599
2021-9-5 2:59:22,3.2.0,juniper_vmx,0:00:07.762834,0:00:08.832251,0:00:18.852219,0:00:37.785493
2021-9-5 3:1:32,3.2.0,cisco_asa,0:00:18.131249,0:00:19.274312,0:00:27.334803,0:00:37.721248
-2021-9-5 12:4:4,4.0.0a4,cisco1,0:00:03.069351,0:00:03.094754,0:00:03.118014,0:00:06.244000
-2021-9-5 12:4:27,4.0.0a4,cisco3,0:00:02.897018,0:00:03.136093,0:00:03.218576,0:00:11.184475
-2021-9-5 12:4:57,4.0.0a4,cisco5,0:00:03.611916,0:00:03.428950,0:00:03.722674,0:00:15.478373
-2021-9-5 12:5:40,4.0.0a4,nxos1,0:00:05.139839,0:00:05.173450,0:00:05.690468,0:00:21.206284
-2021-9-5 12:6:1,4.0.0a4,cisco_xr_azure,0:00:01.825557,0:00:02.395446,0:00:02.922008,0:00:11.205408
-2021-9-5 12:6:30,4.0.0a4,arista1,0:00:01.845722,0:00:02.855799,0:00:02.429823,0:00:18.554945
-2021-9-5 12:7:51,4.0.0a4,juniper_vmx,0:00:05.827800,0:00:06.318494,0:00:19.309357,0:00:30.160754
-2021-9-5 12:8:21,4.0.0a4,cisco_asa,0:00:04.641249,0:00:04.920887,0:00:05.718624,0:00:10.172494
2021-10-2 14:27:36,2.4.2,hp_procurve,0:00:11.258269,0:00:21.831155,0:00:32.216741,0:00:42.488945
2021-10-2 14:29:32,3.0.0,hp_procurve,0:00:17.901763,0:00:22.221532,0:00:30.534230,0:00:42.045111
2021-10-2 14:31:31,3.1.0,hp_procurve,0:00:18.419321,0:00:22.937060,0:00:31.002139,0:00:42.630991
2021-10-2 14:33:29,3.2.0,hp_procurve,0:00:18.353988,0:00:22.718488,0:00:30.893432,0:00:42.584148
2021-10-2 14:35:27,3.3.3,hp_procurve,0:00:18.020695,0:00:22.391657,0:00:30.752905,0:00:42.227986
2021-10-2 14:37:24,3.4.0,hp_procurve,0:00:18.010017,0:00:22.410676,0:00:30.529921,0:00:42.211889
-2021-10-4 14:34:42,4.0.0a4,hp_procurve,0:00:02.184035,0:00:02.524702,0:00:02.561778,0:00:10.813657
+2022-3-23 14:31:9,4.0.0,cisco1,0:00:03.050436,0:00:03.110452,0:00:03.111018,0:00:06.266658
+2022-3-23 14:31:32,4.0.0,cisco3,0:00:03.077292,0:00:02.965434,0:00:03.015565,0:00:10.685372
+2022-3-23 14:31:59,4.0.0,cisco5,0:00:03.532986,0:00:03.203109,0:00:03.529414,0:00:13.502735
+2022-3-23 14:32:44,4.0.0,nxos1,0:00:05.363876,0:00:04.947016,0:00:05.532515,0:00:23.038316
+2022-3-23 14:33:7,4.0.0,cisco_xr_azure,0:00:02.767007,0:00:02.512359,0:00:03.235152,0:00:11.773506
+2022-3-23 14:33:38,4.0.0,arista1,0:00:01.687836,0:00:02.167681,0:00:03.117634,0:00:21.231472
+2022-3-23 14:34:57,4.0.0,juniper_vmx,0:00:05.926020,0:00:06.641656,0:00:17.185611,0:00:32.165569
+2022-3-23 14:35:27,4.0.0,cisco_asa,0:00:05.193105,0:00:04.572510,0:00:05.568892,0:00:09.710037
+2022-3-23 20:55:6,4.0.1a1,hp_procurve,0:00:01.971205,0:00:02.301713,0:00:02.163165,0:00:10.581683
diff --git a/tests/performance/performance_report.md b/tests/performance/performance_report.md
index e4fff7b9c..b527ca8d7 100644
--- a/tests/performance/performance_report.md
+++ b/tests/performance/performance_report.md
@@ -1,10 +1,10 @@
# Netmiko performance
![](graphs/netmiko_arista_eos.svg)
-![](graphs/netmiko_cisco_xr.svg)
-![](graphs/netmiko_cisco_xe.svg)
-![](graphs/netmiko_cisco_ios.svg)
![](graphs/netmiko_cisco_asa.svg)
-![](graphs/netmiko_juniper_junos.svg)
+![](graphs/netmiko_cisco_ios.svg)
![](graphs/netmiko_cisco_nxos.svg)
-![](graphs/netmiko_hp_procurve.svg)
\ No newline at end of file
+![](graphs/netmiko_cisco_xe.svg)
+![](graphs/netmiko_cisco_xr.svg)
+![](graphs/netmiko_hp_procurve.svg)
+![](graphs/netmiko_juniper_junos.svg)
\ No newline at end of file
diff --git a/tests/performance/requirements.txt b/tests/performance/requirements.txt
new file mode 100644
index 000000000..f831c367e
--- /dev/null
+++ b/tests/performance/requirements.txt
@@ -0,0 +1,3 @@
+pyaml
+pygal
+jinja2
diff --git a/tests/performance/test_netmiko.py b/tests/performance/test_netmiko.py
index 155f3b32e..883a555b3 100644
--- a/tests/performance/test_netmiko.py
+++ b/tests/performance/test_netmiko.py
@@ -164,8 +164,8 @@ def remove_old_data(device_name):
def main():
- # PASSWORD = os.environ["HPE_PASSWORD"]
- PASSWORD = os.environ["NORNIR_PASSWORD"]
+ PASSWORD = os.environ["NETMIKO_PASSWORD"]
+ HP_PASSWORD = os.environ["HPE_PASSWORD"]
devices = read_devices()
print("\n\n")
@@ -181,6 +181,8 @@ def main():
dev_dict["password"] = PASSWORD
if dev_name == "cisco_asa":
dev_dict["secret"] = PASSWORD
+ elif dev_name == "hp_procurve":
+ dev_dict["password"] = HP_PASSWORD
# Run tests
operations = [
@@ -200,7 +202,9 @@ def main():
# Some platforms have an issue where the last test affects the
# next test?
if "procurve" in platform:
+ print("Sleeping 30 seconds...")
time.sleep(30)
+ print("Done")
print("-" * 80)
print()
From 2d47afe5693fa6dc5e0a16e85a6726f9e89abe28 Mon Sep 17 00:00:00 2001
From: Glenn
Date: Thu, 24 Mar 2022 21:47:07 +0000
Subject: [PATCH 04/29] fix fortigate autodetect (#2195)
---
netmiko/ssh_autodetect.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/netmiko/ssh_autodetect.py b/netmiko/ssh_autodetect.py
index ac1af68b4..76153c17b 100644
--- a/netmiko/ssh_autodetect.py
+++ b/netmiko/ssh_autodetect.py
@@ -236,7 +236,7 @@
},
"fortinet": {
"cmd": "get system status",
- "search_patterns": [r"FortiOS"],
+ "search_patterns": [r"FortiOS", r"FortiGate"],
"priority": 99,
"dispatch": "_autodetect_std",
},
From 01f7bcb9a617a42ba04f432861228a371c2534a9 Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Thu, 24 Mar 2022 21:10:49 -0700
Subject: [PATCH 05/29] Remove PY3.6 support; add PyYAML as direct dependency
(#2708)
* Remove PY3.6 support; Add PyYAML as direct dependency
* Update license dependencies
---
.github/workflows/commit.yaml | 2 +-
license-dependencies.txt | 5 +++--
netmiko/utilities.py | 9 ++-------
setup.py | 7 +++----
4 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml
index df351a5b8..8ec205967 100644
--- a/.github/workflows/commit.yaml
+++ b/.github/workflows/commit.yaml
@@ -7,7 +7,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
- python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0]
+ python-version: [3.7, 3.8, 3.9, 3.10.0]
steps:
- name: Checkout repository
diff --git a/license-dependencies.txt b/license-dependencies.txt
index 2345b584b..9f568fab4 100644
--- a/license-dependencies.txt
+++ b/license-dependencies.txt
@@ -13,6 +13,7 @@ scp 0.14.4 GNU Library or Lesser General Public License (LGPL)
tenacity 8.0.1 Apache Software License
ntc-templates 3.0.0 Apache Software License
pyserial 3.5 BSD License
+PyYAML 6.0 MIT License
##### Child dependencies
Name Version License
@@ -25,5 +26,5 @@ pycparser 2.21 BSD License
cffi 1.15.0 MIT License
future 0.18.2 MIT License
six 1.16.0 MIT License
-importlib-resources 5.4.0 Apache Software License
-zipp 3.6.0 MIT License
+
+With assistance from `pip-licenses -o license`
diff --git a/netmiko/utilities.py b/netmiko/utilities.py
index d06a2ccd6..03fa37c31 100644
--- a/netmiko/utilities.py
+++ b/netmiko/utilities.py
@@ -19,6 +19,7 @@
from pathlib import Path
import functools
from datetime import datetime
+import importlib.resources as pkg_resources
from textfsm import clitable
from textfsm.clitable import CliTableError
from netmiko import log
@@ -48,12 +49,6 @@
except ImportError:
GENIE_INSTALLED = False
-# If we are on python < 3.7, we need to force the import of importlib.resources backport
-if sys.version_info[:2] >= (3, 7):
- import importlib.resources as pkg_resources
-else:
- import importlib_resources as pkg_resources
-
try:
import serial.tools.list_ports
@@ -302,7 +297,7 @@ def get_template_dir(_skip_ntc_package: bool = False) -> str:
else:
# Try 'pip installed' ntc-templates
try:
- with pkg_resources.path(
+ with pkg_resources.path( # type: ignore
package="ntc_templates", resource="parse.py"
) as posix_path:
# Example: /opt/venv/netmiko/lib/python3.8/site-packages/ntc_templates/templates
diff --git a/setup.py b/setup.py
index 3440c1bf7..928885cff 100644
--- a/setup.py
+++ b/setup.py
@@ -40,7 +40,6 @@ def find_version(*file_paths):
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
@@ -49,13 +48,13 @@ def find_version(*file_paths):
packages=find_packages(exclude=("test*",)),
install_requires=[
"setuptools>=38.4.0",
- "paramiko>=2.6.0",
- "scp>=0.13.2",
+ "paramiko>=2.7.2",
+ "scp>=0.13.3",
"tenacity",
+ "pyyaml>=5.3",
"textfsm>=1.1.2",
"ntc-templates>=2.0.0",
"pyserial",
- "importlib_resources ; python_version<'3.7'",
],
entry_points={
"console_scripts": [
From c76d09fad12c98b1e70176906a4129a53d9be06c Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Wed, 30 Mar 2022 20:06:31 -0700
Subject: [PATCH 06/29] Fix aruba controller paging issue (#2714)
* Fix aruba controller paging issue
* Fix click ci-cd issue
---
netmiko/aruba/aruba_ssh.py | 2 +-
requirements-dev.txt | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/netmiko/aruba/aruba_ssh.py b/netmiko/aruba/aruba_ssh.py
index c79e8f723..527fcbb44 100644
--- a/netmiko/aruba/aruba_ssh.py
+++ b/netmiko/aruba/aruba_ssh.py
@@ -26,7 +26,7 @@ def session_preparation(self) -> None:
self._test_channel_read(pattern=r"[>#]")
self.set_base_prompt()
self.enable()
- self.disable_paging(command="no page")
+ self.disable_paging(command="no paging")
def check_config_mode(
self, check_string: str = "(config) #", pattern: str = r"[>#]"
diff --git a/requirements-dev.txt b/requirements-dev.txt
index 5947ce5dc..e9746140f 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -6,6 +6,8 @@ pytest==6.2.5
pylama==7.7.1
twine==1.13.0
pysnmp==4.4.12
+# Black/click issue (can go away when black is upgraded to >= 22.3.0)
+click==8.0.0
types-paramiko
types-PyYAML
-r requirements.txt
From a19c9dad4dd9f81b5d4b59aecf682138c0f36e84 Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Wed, 6 Apr 2022 13:14:00 -0700
Subject: [PATCH 07/29] Fix Cisco IOS, IOS-XE, and IOS-XR abbreviating prompt
in config mode issue (#2720)
---
netmiko/cisco/cisco_ios.py | 21 +++++++++++++++++++++
netmiko/cisco/cisco_xr.py | 21 +++++++++++++++++++++
tests/conftest.py | 7 +++++++
tests/test_netmiko_config.py | 4 ++++
tests/test_suite_alt.sh | 4 ++++
5 files changed, 57 insertions(+)
diff --git a/netmiko/cisco/cisco_ios.py b/netmiko/cisco/cisco_ios.py
index d9f50722d..51586ef0c 100644
--- a/netmiko/cisco/cisco_ios.py
+++ b/netmiko/cisco/cisco_ios.py
@@ -20,6 +20,27 @@ def session_preparation(self) -> None:
self.disable_paging()
self.set_base_prompt()
+ def set_base_prompt(
+ self,
+ pri_prompt_terminator: str = "#",
+ alt_prompt_terminator: str = ">",
+ delay_factor: float = 1.0,
+ pattern: Optional[str] = None,
+ ) -> str:
+ """
+ Cisco IOS/IOS-XE abbreviates the prompt at 20-chars in config mode.
+
+ Consequently, abbreviate the base_prompt
+ """
+ base_prompt = super().set_base_prompt(
+ pri_prompt_terminator=pri_prompt_terminator,
+ alt_prompt_terminator=alt_prompt_terminator,
+ delay_factor=delay_factor,
+ pattern=pattern,
+ )
+ self.base_prompt = base_prompt[:16]
+ return self.base_prompt
+
def check_config_mode(self, check_string: str = ")#", pattern: str = r"#") -> bool:
"""
Checks if the device is in configuration mode or not.
diff --git a/netmiko/cisco/cisco_xr.py b/netmiko/cisco/cisco_xr.py
index 2bd7e4aed..9c5894bbc 100644
--- a/netmiko/cisco/cisco_xr.py
+++ b/netmiko/cisco/cisco_xr.py
@@ -20,6 +20,27 @@ def session_preparation(self) -> None:
self._test_channel_read(pattern=r"[>#]")
self.set_base_prompt()
+ def set_base_prompt(
+ self,
+ pri_prompt_terminator: str = "#",
+ alt_prompt_terminator: str = ">",
+ delay_factor: float = 1.0,
+ pattern: Optional[str] = None,
+ ) -> str:
+ """
+ Cisco IOS-XR abbreviates the prompt at 31-chars in config mode.
+
+ Consequently, abbreviate the base_prompt
+ """
+ base_prompt = super().set_base_prompt(
+ pri_prompt_terminator=pri_prompt_terminator,
+ alt_prompt_terminator=alt_prompt_terminator,
+ delay_factor=delay_factor,
+ pattern=pattern,
+ )
+ self.base_prompt = base_prompt[:16]
+ return self.base_prompt
+
def send_config_set(
self,
config_commands: Union[str, Sequence[str], TextIO, None] = None,
diff --git a/tests/conftest.py b/tests/conftest.py
index d451a7aad..b97dc7902 100755
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -35,6 +35,13 @@ def net_connect(request):
device = test_devices[device_under_test]
device["verbose"] = False
conn = ConnectHandler(**device)
+ # Temporarily set the hostname
+ if device_under_test == "cisco3_long_name":
+ conn.send_config_set("hostname cisco3-with-a-very-long-hostname")
+ elif device_under_test == "cisco_xr_long_name":
+ conn.send_config_set("hostname iosxr3-with-very-long-hostname-plus")
+ conn.commit()
+ conn.exit_config_mode()
return conn
diff --git a/tests/test_netmiko_config.py b/tests/test_netmiko_config.py
index 7ffabe872..ff16b1e68 100755
--- a/tests/test_netmiko_config.py
+++ b/tests/test_netmiko_config.py
@@ -220,4 +220,8 @@ def test_disconnect(net_connect, commands, expected_responses):
"""
Terminate the SSH session
"""
+ if net_connect.host == "cisco3.lasthop.io":
+ hostname = net_connect.send_command("show run | inc hostname")
+ if "long-hostname" in hostname:
+ net_connect.send_config_set("hostname cisco3")
net_connect.disconnect()
diff --git a/tests/test_suite_alt.sh b/tests/test_suite_alt.sh
index ba174437d..4bd2e8a36 100755
--- a/tests/test_suite_alt.sh
+++ b/tests/test_suite_alt.sh
@@ -12,6 +12,10 @@ echo "Starting tests...good luck:" \
&& $PYTEST test_netmiko_config.py --test_device cisco3 \
&& $PYTEST test_netmiko_config_acl.py --test_device cisco3 \
\
+&& echo "Cisco IOS-XE and IOS-XR Long Name Test" \
+&& $PYTEST test_netmiko_config.py --test_device cisco3_long_name
+&& $PYTEST test_netmiko_config.py --test_device cisco_xr_long_name
+\
&& echo "Exception and Timeout Tests" \
&& $PYTEST test_netmiko_exceptions.py \
\
From 538d9cdd60455e0ab593f502115a4d19a7e7b01b Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Mon, 11 Apr 2022 10:31:02 -0700
Subject: [PATCH 08/29] Cisco wlc send command with yes (updated) (#2727)
* Strip y/n prompt line from output in send_command_w_yes for Cisco WLC
* support for delay factor in send_command_w_yes method for Cisco WLC
* Handling WLC issue where it violates disabling paging requirement
Co-authored-by: kamatha1
---
netmiko/cisco/cisco_wlc_ssh.py | 60 +++++++++++++++++++++++++---------
1 file changed, 44 insertions(+), 16 deletions(-)
diff --git a/netmiko/cisco/cisco_wlc_ssh.py b/netmiko/cisco/cisco_wlc_ssh.py
index 0dcaf31a7..3b6660775 100644
--- a/netmiko/cisco/cisco_wlc_ssh.py
+++ b/netmiko/cisco/cisco_wlc_ssh.py
@@ -51,10 +51,12 @@ def special_login_handler(self, delay_factor: float = 1.0) -> None:
def send_command_w_enter(self, *args: Any, **kwargs: Any) -> str:
"""
For 'show run-config' Cisco WLC adds a 'Press Enter to continue...' message
- Even though pagination is disabled
+ Even though pagination is disabled.
+
show run-config also has excessive delays in the output which requires special
handling.
- Arguments are the same as send_command_timing() method
+
+ Arguments are the same as send_command_timing() method.
"""
if len(args) > 1:
raise ValueError("Must pass in delay_factor as keyword argument")
@@ -64,17 +66,18 @@ def send_command_w_enter(self, *args: Any, **kwargs: Any) -> str:
kwargs["delay_factor"] = self.select_delay_factor(delay_factor)
output = self._send_command_timing_str(*args, **kwargs)
+ second_args = list(args)
+ if len(args) == 1:
+ second_args[0] = self.RETURN
+ else:
+ kwargs["command_string"] = self.RETURN
+ if not kwargs.get("max_loops"):
+ kwargs["max_loops"] = 150
+
if "Press any key" in output or "Press Enter to" in output:
- new_args = list(args)
- if len(args) == 1:
- new_args[0] = self.RETURN
- else:
- kwargs["command_string"] = self.RETURN
- if not kwargs.get("max_loops"):
- kwargs["max_loops"] = 150
# Send an 'enter'
- output += self._send_command_timing_str(*new_args, **kwargs)
+ output += self._send_command_timing_str(*second_args, **kwargs)
# WLC has excessive delay after this appears on screen
if "802.11b Advanced Configuration" in output:
@@ -100,17 +103,42 @@ def send_command_w_enter(self, *args: Any, **kwargs: Any) -> str:
output = self.strip_prompt(output)
return output
- def send_command_w_yes(self, *args: Any, **kwargs: Any) -> str:
+ def _send_command_w_yes(self, *args: Any, **kwargs: Any) -> str:
"""
For 'show interface summary' Cisco WLC adds a
- 'Would you like to display the next 15 entries?' message
+ 'Would you like to display the next 15 entries?' message.
+
Even though pagination is disabled
- Arguments are the same as send_command_timing() method
+ Arguments are the same as send_command_timing() method.
"""
- output = self._send_command_timing_str(*args, **kwargs)
- if "(y/n)" in output:
- output += self._send_command_timing_str("y")
+ if len(args) > 1:
+ raise ValueError("Must pass in delay_factor as keyword argument")
+
+ # If no delay_factor use 1 for default value
+ delay_factor = kwargs.get("delay_factor", 1)
+ kwargs["delay_factor"] = self.select_delay_factor(delay_factor)
+
+ output = ""
+ new_output = self._send_command_timing_str(*args, **kwargs)
+
+ second_args = list(args)
+ if len(args) == 1:
+ second_args[0] = "y"
+ else:
+ kwargs["command_string"] = "y"
strip_prompt = kwargs.get("strip_prompt", True)
+
+ while True:
+ output += new_output
+ if "display the next" in new_output.lower():
+ new_output = self._send_command_timing_str(*second_args, **kwargs)
+ else:
+ break
+
+ # Remove from output 'Would you like to display the next 15 entries? (y/n)'
+ pattern = r"^.*display the next.*\n$"
+ output = re.sub(pattern, "", output, flags=re.M)
+
if strip_prompt:
# Had to strip trailing prompt twice.
output = self.strip_prompt(output)
From a2c7bd5888e499e687f09a9a3e77e9fc9400756a Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Tue, 12 Apr 2022 14:31:54 -0700
Subject: [PATCH 09/29] Fix extreme exos read-only account issue (#2729)
---
netmiko/extreme/extreme_exos.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/netmiko/extreme/extreme_exos.py b/netmiko/extreme/extreme_exos.py
index c78e769d3..064e9b726 100644
--- a/netmiko/extreme/extreme_exos.py
+++ b/netmiko/extreme/extreme_exos.py
@@ -15,7 +15,7 @@ class ExtremeExosBase(NoConfig, CiscoSSHConnection):
"""
def session_preparation(self) -> None:
- self._test_channel_read(pattern=r"#")
+ self._test_channel_read(pattern=r"[>\#]")
self.set_base_prompt()
self.disable_paging(command="disable clipaging")
self.send_command_timing("disable cli prompting")
From 822dcc67beefff5c1dc2415ac7a9ec2ce2146dc3 Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Wed, 13 Apr 2022 13:04:11 -0700
Subject: [PATCH 10/29] Fix issue with 'write memory' on ubiquity edge switches
(#2731)
---
netmiko/ubiquiti/edge_ssh.py | 40 ++++++++++++++++++++++++++++++------
1 file changed, 34 insertions(+), 6 deletions(-)
diff --git a/netmiko/ubiquiti/edge_ssh.py b/netmiko/ubiquiti/edge_ssh.py
index bff0473c5..7ec08c41c 100644
--- a/netmiko/ubiquiti/edge_ssh.py
+++ b/netmiko/ubiquiti/edge_ssh.py
@@ -46,10 +46,38 @@ def exit_enable_mode(self, exit_command: str = "exit") -> str:
def save_config(
self,
cmd: str = "write memory",
- confirm: bool = False,
- confirm_response: str = "",
+ confirm: bool = True,
+ confirm_response: str = "y",
) -> str:
- """Saves configuration."""
- return super().save_config(
- cmd=cmd, confirm=confirm, confirm_response=confirm_response
- )
+ """
+ EdgeSwitch might do the following:
+
+ Are you sure you want to save? (y/n) y
+
+ It is not clear to me that it always does this (or sometimes doesn't).
+
+ Consequently, save_config() handles both cases.
+ """
+ self.enable()
+ confirm_msg = "Are you sure"
+ pattern = rf"({confirm_msg}|\#)"
+ if confirm:
+ output = self._send_command_str(
+ command_string=cmd,
+ expect_string=pattern,
+ strip_prompt=False,
+ strip_command=False,
+ )
+ if confirm_response and confirm_msg in output:
+ output += self._send_command_str(
+ confirm_response,
+ expect_string=r"\#",
+ strip_prompt=False,
+ strip_command=False,
+ )
+ else:
+ # Shouldn't really be here--but handle base case if someone disables "confirm".
+ output = self._send_command_str(
+ command_string=cmd, strip_prompt=False, strip_command=False
+ )
+ return output
From 13fe64055bb8f1ee88dcb0f3a6c710c59c04f13e Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Wed, 13 Apr 2022 14:28:33 -0700
Subject: [PATCH 11/29] Fix issue with Nokia SROS MD-CLI having square bracket
data being stripped in send_command (#2732)
---
netmiko/nokia/nokia_sros.py | 15 ++++++++++-----
netmiko/utilities.py | 15 +++++++++++++++
tests/unit/test_utilities.py | 30 +++++++++++++++++++++++++++++-
3 files changed, 54 insertions(+), 6 deletions(-)
diff --git a/netmiko/nokia/nokia_sros.py b/netmiko/nokia/nokia_sros.py
index dcd82b12b..521531e84 100644
--- a/netmiko/nokia/nokia_sros.py
+++ b/netmiko/nokia/nokia_sros.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
-# Copyright (c) 2014 - 2020 Kirk Byers
-# Copyright (c) 2014 - 2020 Twin Bridges Technology
+# Copyright (c) 2014 - 2022 Kirk Byers
+# Copyright (c) 2014 - 2022 Twin Bridges Technology
# Copyright (c) 2019 - 2020 NOKIA Inc.
# MIT License - See License file at:
# https://github.com/ktbyers/netmiko/blob/develop/LICENSE
@@ -14,6 +14,7 @@
from netmiko import log
from netmiko.base_connection import BaseConnection
from netmiko.scp_handler import BaseFileTransfer
+from netmiko.utilities import nokia_context_filter
class NokiaSros(BaseConnection):
@@ -226,9 +227,13 @@ def strip_prompt(self, *args: Any, **kwargs: Any) -> str:
"""Strip prompt from the output."""
output = super().strip_prompt(*args, **kwargs)
if "@" in self.base_prompt:
- # Remove context prompt too
- strips = r"[\r\n]*\!?\*?(\((ex|gl|pr|ro)\))?\[\S*\][\r\n]*"
- return re.sub(strips, "", output)
+ # Remove Nokia context prompt too
+ output_list = output.rstrip().splitlines()
+ last_line = output_list[-1]
+ other_lines = output_list[:-1]
+ last_line = nokia_context_filter(last_line)
+ output_list = other_lines + [last_line]
+ return "\n".join(output_list).rstrip()
else:
return output
diff --git a/netmiko/utilities.py b/netmiko/utilities.py
index 03fa37c31..ac36afa82 100644
--- a/netmiko/utilities.py
+++ b/netmiko/utilities.py
@@ -12,6 +12,7 @@
Tuple,
)
from typing import TYPE_CHECKING
+import re
from glob import glob
import sys
import io
@@ -650,3 +651,17 @@ def calc_old_timeout(
max_loops = int(old_timeout / loop_delay)
return max_loops * loop_delay * delay_factor
+
+
+def nokia_context_filter(data: str, re_flags: int = re.M) -> str:
+ """
+ Nokia context from string. Examples:
+
+ (ro)[]
+
+ (ex)[configure router "Base" bgp]
+
+ Converted over to a standalone function for easier unit testing.
+ """
+ context_pattern = r"^\!?\*?(\((ex|gl|pr|ro)\))?\[.*\]"
+ return re.sub(context_pattern, "", data, flags=re_flags)
diff --git a/tests/unit/test_utilities.py b/tests/unit/test_utilities.py
index 4355dabd2..12dd19a96 100755
--- a/tests/unit/test_utilities.py
+++ b/tests/unit/test_utilities.py
@@ -231,7 +231,7 @@ def test_ntc_templates_discovery():
# Next should use local index file in ~
home_dir = os.path.expanduser("~")
# Will not work for CI-CD without pain so just test locally
- if "kbyers" in home_dir:
+ if "kbyers" in home_dir or "ktbyers" in home_dir:
ntc_path = utilities.get_template_dir(_skip_ntc_package=True)
assert ntc_path == f"{home_dir}/ntc-templates/ntc_templates/templates"
else:
@@ -394,3 +394,31 @@ def test_delay_factor_compat(max_loops, delay_factor, timeout, result):
)
print(read_timeout)
assert read_timeout == result
+
+
+def test_nokia_context_filter():
+ data = [
+ "(ex)[configure aaa]",
+ "*(ex)[configure aaa]",
+ "!(ex)[configure aaa]",
+ "[]",
+ '(ex)[configure router "Base" bgp]',
+ "(ro)[]",
+ "(ex)[]",
+ '[show router "Base" bgp]',
+ '!*[pr:configure router "Base" bgp]',
+ ]
+
+ results = []
+
+ for test_case in data:
+ out = utilities.nokia_context_filter(test_case)
+ results.append(out)
+
+ # All strings in results should be null-string
+ assert any(results) is False
+
+ # Create a case that won't be stripped
+ test_case = 'foo[show router "Base" bgp]'
+ out = utilities.nokia_context_filter(test_case)
+ assert out != ""
From fca1b3c1cc1fccc88ed49bf1c227915788bdd548 Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Wed, 13 Apr 2022 21:24:09 -0700
Subject: [PATCH 12/29] Improve Juniper enter cli mode (#2733)
---
netmiko/juniper/juniper.py | 37 ++++++++++++++++++++++++-------------
1 file changed, 24 insertions(+), 13 deletions(-)
diff --git a/netmiko/juniper/juniper.py b/netmiko/juniper/juniper.py
index f2fd19e7d..2a1391420 100644
--- a/netmiko/juniper/juniper.py
+++ b/netmiko/juniper/juniper.py
@@ -1,5 +1,4 @@
import re
-import time
import warnings
from typing import Optional, Any
@@ -17,7 +16,10 @@ class JuniperBase(NoEnable, BaseConnection):
def session_preparation(self) -> None:
"""Prepare the session after the connection has been established."""
+ pattern = r"[%>$#]"
+ self._test_channel_read(pattern=pattern)
self.enter_cli_mode()
+
cmd = "set cli screen-width 511"
self.set_terminal_width(command=cmd, pattern=r"Screen width set to")
# Overloading disable_paging which is confusing
@@ -38,23 +40,32 @@ def _return_cli(self) -> str:
"""Return to the Juniper CLI."""
return self._send_command_str("exit", expect_string=r"[#>]")
+ def _determine_mode(self, data: str = "") -> str:
+ """Determine whether in shell or CLI."""
+ pattern = r"[%>$#]"
+ if not data:
+ self.write_channel(self.RETURN)
+ data = self.read_until_pattern(pattern=pattern, read_timeout=10)
+
+ if "%" in data or "$" in data:
+ return "shell"
+ elif ">" in data or "#" in data:
+ return "cli"
+ else:
+ raise ValueError(f"Unexpected data returned for prompt: {data}")
+
def enter_cli_mode(self) -> None:
"""Check if at shell prompt root@ and go into CLI."""
- delay_factor = self.select_delay_factor(delay_factor=0)
- count = 0
- cur_prompt = ""
- while count < 50:
+ mode = self._determine_mode()
+ if mode == "shell":
+ shell_pattern = r"[%$]"
self.write_channel(self.RETURN)
- time.sleep(0.1 * delay_factor)
- cur_prompt = self.read_channel()
+ cur_prompt = self.read_until_pattern(pattern=shell_pattern, read_timeout=10)
if re.search(r"root@", cur_prompt) or re.search(r"^%$", cur_prompt.strip()):
+ cli_pattern = r"[>#]"
self.write_channel("cli" + self.RETURN)
- time.sleep(0.3 * delay_factor)
- self.clear_buffer()
- break
- elif ">" in cur_prompt or "#" in cur_prompt:
- break
- count += 1
+ self.read_until_pattern(pattern=cli_pattern, read_timeout=10)
+ return
def check_config_mode(self, check_string: str = "]", pattern: str = "") -> bool:
"""Checks if the device is in configuration mode or not."""
From b3119c53de2b2a3c2b9ceb5421fc0913a95e9114 Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Thu, 14 Apr 2022 09:16:03 -0700
Subject: [PATCH 13/29] Updates to Huawei Login issue fix (#2728)
* fix(huawei): fix special_login_handler (#2711)
* Relocate password change code back to special_login_handler
* Fix issue you could get into where prompt might not be available.
* Increase timeouts to allow for more time during initial read.
Remove the _test_channel_read()
* Removing ReadTimeout handling
Co-authored-by: Florian Harbecke
---
netmiko/huawei/huawei.py | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/netmiko/huawei/huawei.py b/netmiko/huawei/huawei.py
index 12dd7e156..50b6eace5 100644
--- a/netmiko/huawei/huawei.py
+++ b/netmiko/huawei/huawei.py
@@ -11,10 +11,19 @@
class HuaweiBase(NoEnable, CiscoBaseConnection):
+ def special_login_handler(self, delay_factor: float = 1.0) -> None:
+ # Huawei prompts for password change before displaying the initial base prompt.
+ # Search for that password change prompt or for base prompt.
+ password_change_prompt = r"(Change now|Please choose)"
+ data = self.read_until_pattern(pattern=rf"({password_change_prompt}|[>\]])")
+ if re.search(password_change_prompt, data):
+ self.write_channel("N" + self.RETURN)
+ self.read_until_pattern(pattern=r"[>\]]")
+
def session_preparation(self) -> None:
"""Prepare the session after the connection has been established."""
self.ansi_escape_codes = True
- self._test_channel_read(pattern=r"[>\]]")
+ # The _test_channel_read happens in special_login_handler()
self.set_base_prompt()
self.disable_paging(command="screen-length 0 temporary")
@@ -97,16 +106,7 @@ def save_config(
class HuaweiSSH(HuaweiBase):
"""Huawei SSH driver."""
- def special_login_handler(self, delay_factor: float = 1.0) -> None:
- """Handle password change request by ignoring it"""
-
- # Huawei can prompt for password change. Search for that or for normal prompt
- password_change_prompt = r"((Change now|Please choose))|([\]>]\s*$)"
- output = self.read_until_pattern(password_change_prompt)
- if re.search(password_change_prompt, output):
- self.write_channel("N\n")
- self.clear_buffer()
- return None
+ pass
class HuaweiTelnet(HuaweiBase):
From 42ecb74aa24d845232c34862ccb4af6475b1f8b7 Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Thu, 14 Apr 2022 11:10:43 -0700
Subject: [PATCH 14/29] Expand iosxr prompt length in set_base_prompt() (#2734)
* Expand length of ios-xr prompt
* Fixing long name test issue
---
netmiko/cisco/cisco_xr.py | 2 +-
tests/SLOG/netmiko.log | 6 ++++++
tests/test_cisco_ios/testx.txt | 1 -
tests/test_netmiko_config.py | 9 +++++++--
tests/test_suite_alt.sh | 4 ++--
5 files changed, 16 insertions(+), 6 deletions(-)
delete mode 100644 tests/test_cisco_ios/testx.txt
diff --git a/netmiko/cisco/cisco_xr.py b/netmiko/cisco/cisco_xr.py
index 9c5894bbc..2dd4c84f7 100644
--- a/netmiko/cisco/cisco_xr.py
+++ b/netmiko/cisco/cisco_xr.py
@@ -38,7 +38,7 @@ def set_base_prompt(
delay_factor=delay_factor,
pattern=pattern,
)
- self.base_prompt = base_prompt[:16]
+ self.base_prompt = base_prompt[:31]
return self.base_prompt
def send_config_set(
diff --git a/tests/SLOG/netmiko.log b/tests/SLOG/netmiko.log
index 20345762d..bf64a8446 100644
--- a/tests/SLOG/netmiko.log
+++ b/tests/SLOG/netmiko.log
@@ -58,6 +58,9 @@ Clear buffer detects data in the channel
read_channel:
write_channel: b'\n'
read_channel:
+read_channel:
+cisco1>
+Pattern found: (\#|>)
cisco1>
read_channel:
[find_prompt()]: prompt is cisco1>
@@ -85,6 +88,9 @@ Clear buffer detects data in the channel
read_channel:
write_channel: b'\n'
read_channel:
+read_channel:
+cisco1>
+Pattern found: (\#|>)
cisco1>
read_channel:
[find_prompt()]: prompt is cisco1>
diff --git a/tests/test_cisco_ios/testx.txt b/tests/test_cisco_ios/testx.txt
deleted file mode 100644
index acc8e3dd5..000000000
--- a/tests/test_cisco_ios/testx.txt
+++ /dev/null
@@ -1 +0,0 @@
-no logging console
diff --git a/tests/test_netmiko_config.py b/tests/test_netmiko_config.py
index ff16b1e68..5e3f04eee 100755
--- a/tests/test_netmiko_config.py
+++ b/tests/test_netmiko_config.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+import re
import pytest
from netmiko import ConfigInvalidException
from netmiko import ReadTimeout
@@ -220,8 +221,12 @@ def test_disconnect(net_connect, commands, expected_responses):
"""
Terminate the SSH session
"""
- if net_connect.host == "cisco3.lasthop.io":
+ if net_connect.host in ["cisco3.lasthop.io", "iosxr3.lasthop.io"]:
hostname = net_connect.send_command("show run | inc hostname")
- if "long-hostname" in hostname:
+ if re.search("cisco3.*long", hostname):
net_connect.send_config_set("hostname cisco3")
+ elif re.search("iosxr3.*long", hostname):
+ net_connect.send_config_set("hostname iosxr3")
+ net_connect.commit()
+ net_connect.exit_config_mode()
net_connect.disconnect()
diff --git a/tests/test_suite_alt.sh b/tests/test_suite_alt.sh
index 4bd2e8a36..8b5b4d1e6 100755
--- a/tests/test_suite_alt.sh
+++ b/tests/test_suite_alt.sh
@@ -13,8 +13,8 @@ echo "Starting tests...good luck:" \
&& $PYTEST test_netmiko_config_acl.py --test_device cisco3 \
\
&& echo "Cisco IOS-XE and IOS-XR Long Name Test" \
-&& $PYTEST test_netmiko_config.py --test_device cisco3_long_name
-&& $PYTEST test_netmiko_config.py --test_device cisco_xr_long_name
+&& $PYTEST test_netmiko_config.py --test_device cisco3_long_name \
+&& $PYTEST test_netmiko_config.py --test_device cisco_xr_long_name \
\
&& echo "Exception and Timeout Tests" \
&& $PYTEST test_netmiko_exceptions.py \
From d443cb9da42551663bcd93cbad187e7097cb0db8 Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Thu, 14 Apr 2022 13:45:26 -0700
Subject: [PATCH 15/29] Improve tests to determine if running in GH Actions
(#2735)
---
.github/workflows/commit.yaml | 2 ++
tests/unit/test_utilities.py | 5 +++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml
index 8ec205967..3ec16bfbd 100644
--- a/.github/workflows/commit.yaml
+++ b/.github/workflows/commit.yaml
@@ -1,6 +1,8 @@
---
name: build
on: [push, pull_request]
+env:
+ environment: gh_actions
jobs:
std_tests:
runs-on: ubuntu-latest
diff --git a/tests/unit/test_utilities.py b/tests/unit/test_utilities.py
index 12dd19a96..6c8f1b330 100755
--- a/tests/unit/test_utilities.py
+++ b/tests/unit/test_utilities.py
@@ -229,9 +229,10 @@ def test_ntc_templates_discovery():
assert ntc_path == f"{packages_dir}/ntc_templates/templates"
# Next should use local index file in ~
- home_dir = os.path.expanduser("~")
# Will not work for CI-CD without pain so just test locally
- if "kbyers" in home_dir or "ktbyers" in home_dir:
+ environment = os.getenv("environment", "local")
+ if environment != "gh_actions":
+ home_dir = os.path.expanduser("~")
ntc_path = utilities.get_template_dir(_skip_ntc_package=True)
assert ntc_path == f"{home_dir}/ntc-templates/ntc_templates/templates"
else:
From 89b45fb1977aa04d685fc240c83496c37442353c Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Thu, 14 Apr 2022 19:15:41 -0700
Subject: [PATCH 16/29] Huawei fix regular expression issue (#2737)
---
netmiko/base_connection.py | 2 +-
netmiko/huawei/huawei.py | 19 +++++++++----------
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/netmiko/base_connection.py b/netmiko/base_connection.py
index a3a19ded2..f15b3152b 100644
--- a/netmiko/base_connection.py
+++ b/netmiko/base_connection.py
@@ -615,7 +615,7 @@ def read_until_pattern(
results = re.split(pattern, output, maxsplit=1, flags=re_flags)
# The string matched by pattern must be retained in the output string.
- # re.split will do this if capturing parentesis are used.
+ # re.split will do this if capturing parenthesis are used.
if len(results) == 2:
# no capturing parenthesis, convert and try again.
pattern = f"({pattern})"
diff --git a/netmiko/huawei/huawei.py b/netmiko/huawei/huawei.py
index 50b6eace5..326038a24 100644
--- a/netmiko/huawei/huawei.py
+++ b/netmiko/huawei/huawei.py
@@ -11,15 +11,6 @@
class HuaweiBase(NoEnable, CiscoBaseConnection):
- def special_login_handler(self, delay_factor: float = 1.0) -> None:
- # Huawei prompts for password change before displaying the initial base prompt.
- # Search for that password change prompt or for base prompt.
- password_change_prompt = r"(Change now|Please choose)"
- data = self.read_until_pattern(pattern=rf"({password_change_prompt}|[>\]])")
- if re.search(password_change_prompt, data):
- self.write_channel("N" + self.RETURN)
- self.read_until_pattern(pattern=r"[>\]]")
-
def session_preparation(self) -> None:
"""Prepare the session after the connection has been established."""
self.ansi_escape_codes = True
@@ -106,7 +97,15 @@ def save_config(
class HuaweiSSH(HuaweiBase):
"""Huawei SSH driver."""
- pass
+ def special_login_handler(self, delay_factor: float = 1.0) -> None:
+ # Huawei prompts for password change before displaying the initial base prompt.
+ # Search for that password change prompt or for base prompt.
+ password_change_prompt = r"(Change now|Please choose)"
+ prompt_or_password_change = r"(?:Change now|Please choose|[>\]])"
+ data = self.read_until_pattern(pattern=prompt_or_password_change)
+ if re.search(password_change_prompt, data):
+ self.write_channel("N" + self.RETURN)
+ self.read_until_pattern(pattern=r"[>\]]")
class HuaweiTelnet(HuaweiBase):
From 3198fc21e320a718c8abf28579411303d4df82cf Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Mon, 25 Apr 2022 10:52:06 -0700
Subject: [PATCH 17/29] Fix issue with read_timeout being excessively long in
case where check_config_mode fails (#2751)
---
netmiko/base_connection.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/netmiko/base_connection.py b/netmiko/base_connection.py
index f15b3152b..c78fd4d50 100644
--- a/netmiko/base_connection.py
+++ b/netmiko/base_connection.py
@@ -1122,7 +1122,7 @@ def _increment_delay(
time.sleep(main_delay * 10)
new_data = ""
while i <= count:
- new_data += self.read_channel_timing()
+ new_data += self.read_channel_timing(read_timeout=20)
if new_data:
return new_data
@@ -1943,7 +1943,7 @@ def check_config_mode(self, check_string: str = "", pattern: str = "") -> bool:
self.write_channel(self.RETURN)
# You can encounter an issue here (on router name changes) prefer delay-based solution
if not pattern:
- output = self.read_channel_timing()
+ output = self.read_channel_timing(read_timeout=10.0)
else:
output = self.read_until_pattern(pattern=pattern)
return check_string in output
From e026cac591102a6004fceb500317f55886568900 Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Mon, 25 Apr 2022 12:39:11 -0700
Subject: [PATCH 18/29] Update vyos save_config() (#2752)
---
netmiko/vyos/vyos_ssh.py | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/netmiko/vyos/vyos_ssh.py b/netmiko/vyos/vyos_ssh.py
index 9b3652648..ab6c2ded5 100644
--- a/netmiko/vyos/vyos_ssh.py
+++ b/netmiko/vyos/vyos_ssh.py
@@ -131,10 +131,12 @@ def send_config_set(
)
def save_config(
- self,
- cmd: str = "copy running-config startup-config",
- confirm: bool = False,
- confirm_response: str = "",
+ self, cmd: str = "save", confirm: bool = False, confirm_response: str = ""
) -> str:
- """Not Implemented"""
- raise NotImplementedError
+ """Saves Config."""
+ output = super().save_config(
+ cmd=cmd, confirm=confirm, confirm_response=confirm_response
+ )
+ if "Done" not in output:
+ raise ValueError(f"Save failed with following errors:\n\n{output}")
+ return output
From a69691c3139d04bf183741b6e6f4a7cb4417de11 Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Mon, 25 Apr 2022 14:21:43 -0700
Subject: [PATCH 19/29] Improving slow Juniper performance on disconnect
(#2753)
---
netmiko/juniper/juniper.py | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/netmiko/juniper/juniper.py b/netmiko/juniper/juniper.py
index 2a1391420..320be281c 100644
--- a/netmiko/juniper/juniper.py
+++ b/netmiko/juniper/juniper.py
@@ -67,9 +67,11 @@ def enter_cli_mode(self) -> None:
self.read_until_pattern(pattern=cli_pattern, read_timeout=10)
return
- def check_config_mode(self, check_string: str = "]", pattern: str = "") -> bool:
+ def check_config_mode(
+ self, check_string: str = "]", pattern: str = r"[>#]"
+ ) -> bool:
"""Checks if the device is in configuration mode or not."""
- return super().check_config_mode(check_string=check_string)
+ return super().check_config_mode(check_string=check_string, pattern=pattern)
def config_mode(
self,
@@ -88,12 +90,17 @@ def exit_config_mode(
"""Exit configuration mode."""
output = ""
if self.check_config_mode():
- output = self._send_command_timing_str(
- exit_config, strip_prompt=False, strip_command=False
+ confirm_msg = "Exit with uncommitted changes"
+ pattern = rf"(?:>|{confirm_msg})"
+ output = self._send_command_str(
+ exit_config,
+ expect_string=pattern,
+ strip_prompt=False,
+ strip_command=False,
)
- if "Exit with uncommitted changes?" in output:
- output += self._send_command_timing_str(
- "yes", strip_prompt=False, strip_command=False
+ if confirm_msg in output:
+ output += self._send_command_str(
+ "yes", expect_string=r">", strip_prompt=False, strip_command=False
)
if self.check_config_mode():
raise ValueError("Failed to exit configuration mode")
@@ -221,8 +228,7 @@ def strip_context_items(self, a_string: str) -> str:
def cleanup(self, command: str = "exit") -> None:
"""Gracefully exit the SSH session."""
try:
- # The pattern="" forces use of send_command_timing
- if self.check_config_mode(pattern=""):
+ if self.check_config_mode():
self.exit_config_mode()
except Exception:
pass
From b6761bc22f61bf2861821e102c2b79c4e0db57fb Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Mon, 25 Apr 2022 14:53:31 -0700
Subject: [PATCH 20/29] Improve general performance on disconnect; fix slow
NX-OS disconnect (#2754)
---
netmiko/cisco_base_connection.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/netmiko/cisco_base_connection.py b/netmiko/cisco_base_connection.py
index abd94fa1b..48627e9ad 100644
--- a/netmiko/cisco_base_connection.py
+++ b/netmiko/cisco_base_connection.py
@@ -191,8 +191,7 @@ def telnet_login(
def cleanup(self, command: str = "exit") -> None:
"""Gracefully exit the SSH session."""
try:
- # The pattern="" forces use of send_command_timing
- if self.check_config_mode(pattern=""):
+ if self.check_config_mode():
self.exit_config_mode()
except Exception:
pass
From 6ae038c299d2c1fa9d44025e152f1915760448bb Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Mon, 25 Apr 2022 17:45:18 -0700
Subject: [PATCH 21/29] Fix issue with check_config_mode when not at higher
privilege (#2756)
---
netmiko/cisco/cisco_ios.py | 4 +++-
netmiko/cisco/cisco_nxos_ssh.py | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/netmiko/cisco/cisco_ios.py b/netmiko/cisco/cisco_ios.py
index 51586ef0c..9c4b90148 100644
--- a/netmiko/cisco/cisco_ios.py
+++ b/netmiko/cisco/cisco_ios.py
@@ -41,7 +41,9 @@ def set_base_prompt(
self.base_prompt = base_prompt[:16]
return self.base_prompt
- def check_config_mode(self, check_string: str = ")#", pattern: str = r"#") -> bool:
+ def check_config_mode(
+ self, check_string: str = ")#", pattern: str = r"[>#]"
+ ) -> bool:
"""
Checks if the device is in configuration mode or not.
diff --git a/netmiko/cisco/cisco_nxos_ssh.py b/netmiko/cisco/cisco_nxos_ssh.py
index d41bfffc6..7a78b06f4 100644
--- a/netmiko/cisco/cisco_nxos_ssh.py
+++ b/netmiko/cisco/cisco_nxos_ssh.py
@@ -24,7 +24,9 @@ def normalize_linefeeds(self, a_string: str) -> str:
# NX-OS fix for incorrect MD5 on 9K (due to strange patterns on NX-OS)
return newline.sub(self.RESPONSE_RETURN, a_string).replace("\r", "\n")
- def check_config_mode(self, check_string: str = ")#", pattern: str = "#") -> bool:
+ def check_config_mode(
+ self, check_string: str = ")#", pattern: str = r"[>#]"
+ ) -> bool:
"""Checks if the device is in configuration mode or not."""
return super().check_config_mode(check_string=check_string, pattern=pattern)
From e803f66d454186e865b44563f29c37ae5a0000ac Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Tue, 26 Apr 2022 11:06:16 -0700
Subject: [PATCH 22/29] Improve junos check_config_mode to handle
commit-confirm message (#2758)
that appears in and out of config mode with a "#"
---
netmiko/juniper/juniper.py | 12 ++++++++++--
tests/test_netmiko_show.py | 2 +-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/netmiko/juniper/juniper.py b/netmiko/juniper/juniper.py
index 320be281c..fbe8d8b99 100644
--- a/netmiko/juniper/juniper.py
+++ b/netmiko/juniper/juniper.py
@@ -68,9 +68,17 @@ def enter_cli_mode(self) -> None:
return
def check_config_mode(
- self, check_string: str = "]", pattern: str = r"[>#]"
+ self, check_string: str = "]", pattern: str = r"(?m)[>#] $"
) -> bool:
- """Checks if the device is in configuration mode or not."""
+ """
+ Checks if the device is in configuration mode or not.
+
+ (?m) = Use multiline matching
+
+ Juniper unfortunately will use # as a message indicator when not in config mode
+ For example, with commit confirmed.
+
+ """
return super().check_config_mode(check_string=check_string, pattern=pattern)
def config_mode(
diff --git a/tests/test_netmiko_show.py b/tests/test_netmiko_show.py
index 1bbcfafa0..f85acba27 100755
--- a/tests/test_netmiko_show.py
+++ b/tests/test_netmiko_show.py
@@ -377,4 +377,4 @@ def test_disconnect_no_enable(net_connect_newconn, commands, expected_responses)
assert net_connect.remote_conn is None
assert time_delta.total_seconds() < 5
else:
- assert True
+ assert pytest.skip()
From b4abd209ee120411e15ca8d0e4ad17760b72cdef Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Tue, 26 Apr 2022 13:39:00 -0700
Subject: [PATCH 23/29] Add save_config to performance test (#2759)
---
tests/performance/test_devices.yml | 18 +++++++++---------
tests/performance/test_netmiko.py | 12 ++++++++++++
2 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/tests/performance/test_devices.yml b/tests/performance/test_devices.yml
index a2b08ff9e..565bce1f4 100644
--- a/tests/performance/test_devices.yml
+++ b/tests/performance/test_devices.yml
@@ -55,15 +55,15 @@ juniper_vmx:
graph:
title: "Netmiko: Juniper Junos Performance"
-cisco_asa:
- device:
- device_type: cisco_asa
- ip: 184.105.247.88
- username: pyclass
- allow_auto_change: True
- session_log: asa1.out
- graph:
- title: "Netmiko: Cisco ASA Performance"
+#cisco_asa:
+# device:
+# device_type: cisco_asa
+# ip: 184.105.247.88
+# username: pyclass
+# allow_auto_change: True
+# session_log: asa1.out
+# graph:
+# title: "Netmiko: Cisco ASA Performance"
hp_procurve:
device:
diff --git a/tests/performance/test_netmiko.py b/tests/performance/test_netmiko.py
index 883a555b3..0a3e0a6c4 100644
--- a/tests/performance/test_netmiko.py
+++ b/tests/performance/test_netmiko.py
@@ -95,6 +95,17 @@ def send_command_simple(device):
PRINT_DEBUG and print(output)
+@f_exec_time
+def save_config(device):
+ platform = device["device_type"]
+ if "cisco_xr" in platform or "juniper" in platform:
+ return
+ with ConnectHandler(**device) as conn:
+ platform = device["device_type"]
+ output = conn.save_config()
+ PRINT_DEBUG and print(output)
+
+
@f_exec_time
def send_config_simple(device):
with ConnectHandler(**device) as conn:
@@ -188,6 +199,7 @@ def main():
operations = [
"connect",
"send_command_simple",
+ # "save_config",
"send_config_simple",
"send_config_large_acl",
"cleanup",
From 276fa263e5760eb10abaf65b095dd8e112377cc8 Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Tue, 26 Apr 2022 13:58:39 -0700
Subject: [PATCH 24/29] Updating performance graphs (#2760)
---
tests/performance/graphs/netmiko_arista_eos.svg | 6 +++---
tests/performance/graphs/netmiko_cisco_ios.svg | 6 +++---
tests/performance/graphs/netmiko_cisco_nxos.svg | 6 +++---
tests/performance/graphs/netmiko_cisco_xe.svg | 6 +++---
tests/performance/graphs/netmiko_cisco_xr.svg | 6 +++---
tests/performance/graphs/netmiko_hp_procurve.svg | 12 +++---------
tests/performance/graphs/netmiko_juniper_junos.svg | 6 +++---
tests/performance/netmiko_performance.csv | 9 ++++++++-
tests/performance/performance_report.md | 10 +++++-----
9 files changed, 34 insertions(+), 33 deletions(-)
diff --git a/tests/performance/graphs/netmiko_arista_eos.svg b/tests/performance/graphs/netmiko_arista_eos.svg
index 1698ebec0..cdde78f6e 100644
--- a/tests/performance/graphs/netmiko_arista_eos.svg
+++ b/tests/performance/graphs/netmiko_arista_eos.svg
@@ -1,4 +1,4 @@
-Netmiko: Arista EOS Performance (vEOS) 0 0 10 10 20 20 30 30 40 40 50 50 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0 Netmiko: Arista EOS Performance (vEOS) 5.600851 11.669230769230769 455.2731705209025 2.4.2 6.21565 108.91282051282049 449.9118166153846 3.0.0 6.25804 206.15641025641023 449.54215467375025 3.1.0 8.236209 303.4 432.2915343996048 3.2.0 1.904317 400.64358974358964 487.50879061426554 3.3.3 2.280802 497.88717948717954 484.22565364572966 3.4.0 1.687836 595.1307692307691 489.39661290223347 4.0.0 6.615937 11.669230769230769 446.42111433581357 2.4.2 6.971088 108.91282051282049 443.32402048741994 3.0.0 6.7046 206.15641025641023 445.6479287559331 3.1.0 8.897231 303.4 426.52709288077796 3.2.0 2.497181 400.64358974358964 482.3387208486333 3.3.3 2.81286 497.88717948717954 479.5858425265476 3.4.0 2.167681 595.1307692307691 485.21212518381947 4.0.0 8.651368 11.669230769230769 428.6711408627564 2.4.2 7.130959 108.91282051282049 441.92986563318453 3.0.0 7.223195 206.15641025641023 441.1255217113022 3.1.0 17.371332 303.4 352.6287057784849 3.2.0 3.357669 400.64358974358964 474.83483632791797 3.3.3 2.930811 497.88717948717954 478.55725097953837 3.4.0 3.117634 595.1307692307691 476.92806124323334 4.0.0 17.739594 11.669230769230769 349.417277471097 2.4.2 34.856952 108.91282051282049 200.14537858146457 3.0.0 34.630821 206.15641025641023 202.11735368228398 3.1.0 56.674599 303.4 9.884615384615415 3.2.0 32.008313 400.64358974358964 224.98693139475876 3.3.3 30.11219 497.88717948717954 241.52206962919348 3.4.0 21.231472 595.1307692307691 318.96635976808864 4.0.0 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Arista EOS Performance (vEOS) 0 0 10 10 20 20 30 30 40 40 50 50 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.1a1 Netmiko: Arista EOS Performance (vEOS) 5.600851 11.669230769230769 455.2731705209025 2.4.2 6.21565 108.91282051282049 449.9118166153846 3.0.0 6.25804 206.15641025641023 449.54215467375025 3.1.0 8.236209 303.4 432.2915343996048 3.2.0 1.904317 400.64358974358964 487.50879061426554 3.3.3 2.280802 497.88717948717954 484.22565364572966 3.4.0 1.705048 595.1307692307691 489.246515677902 4.0.1a1 6.615937 11.669230769230769 446.42111433581357 2.4.2 6.971088 108.91282051282049 443.32402048741994 3.0.0 6.7046 206.15641025641023 445.6479287559331 3.1.0 8.897231 303.4 426.52709288077796 3.2.0 2.497181 400.64358974358964 482.3387208486333 3.3.3 2.81286 497.88717948717954 479.5858425265476 3.4.0 2.553805 595.1307692307691 481.8449313279183 4.0.1a1 8.651368 11.669230769230769 428.6711408627564 2.4.2 7.130959 108.91282051282049 441.92986563318453 3.0.0 7.223195 206.15641025641023 441.1255217113022 3.1.0 17.371332 303.4 352.6287057784849 3.2.0 3.357669 400.64358974358964 474.83483632791797 3.3.3 2.930811 497.88717948717954 478.55725097953837 3.4.0 2.970468 595.1307692307691 478.2114221609633 4.0.1a1 17.739594 11.669230769230769 349.417277471097 2.4.2 34.856952 108.91282051282049 200.14537858146457 3.0.0 34.630821 206.15641025641023 202.11735368228398 3.1.0 56.674599 303.4 9.884615384615415 3.2.0 32.008313 400.64358974358964 224.98693139475876 3.3.3 30.11219 497.88717948717954 241.52206962919348 3.4.0 20.467766 595.1307692307691 325.6262569796446 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_cisco_ios.svg b/tests/performance/graphs/netmiko_cisco_ios.svg
index aace099fb..ede7ebc33 100644
--- a/tests/performance/graphs/netmiko_cisco_ios.svg
+++ b/tests/performance/graphs/netmiko_cisco_ios.svg
@@ -1,4 +1,4 @@
-Netmiko: Cisco IOS Performance (Cisco 881) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 4.0.0 Netmiko: Cisco IOS Performance (Cisco 881) 5.015699 11.669230769230769 369.8405610719277 2.4.2 5.692225 128.36153846153843 351.7293448142215 3.0.0 7.7883 245.05384615384614 295.6155108782434 3.1.0 7.71581 361.7461538461538 297.55613410118104 3.2.0 3.047461 478.4384615384615 422.5320822620004 3.3.3 3.050436 595.1307692307691 422.4524388065136 4.0.0 5.437302 11.669230769230769 358.5538653530674 2.4.2 6.039594 128.36153846153843 342.4299607843052 3.0.0 8.142923 245.05384615384614 286.1219306714863 3.1.0 8.145355 361.7461538461538 286.0568238198077 3.2.0 3.134423 478.4384615384615 420.20403043811984 3.3.3 3.110452 595.1307692307691 420.845755907523 4.0.0 7.712221 11.669230769230769 297.652214895044 2.4.2 5.965445 128.36153846153843 344.41499694594967 3.0.0 8.065553 245.05384615384614 288.19319593233183 3.1.0 8.06323 361.7461538461538 288.255384754885 3.2.0 3.140944 478.4384615384615 420.0294573378746 3.3.3 3.111018 595.1307692307691 420.8306035727985 4.0.0 12.729495 11.669230769230769 163.33522716927052 2.4.2 16.356528 128.36153846153843 66.23625530885886 3.0.0 18.461486 245.05384615384614 9.884615384615415 3.1.0 18.446518 361.7461538461538 10.285322356624306 3.2.0 5.528239 478.4384615384615 356.11939916429264 3.3.3 6.266658 595.1307692307691 336.3512510106383 4.0.0 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Cisco IOS Performance (Cisco 881) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 4.0.1a1 Netmiko: Cisco IOS Performance (Cisco 881) 5.015699 11.669230769230769 369.8405610719277 2.4.2 5.692225 128.36153846153843 351.7293448142215 3.0.0 7.7883 245.05384615384614 295.6155108782434 3.1.0 7.71581 361.7461538461538 297.55613410118104 3.2.0 3.047461 478.4384615384615 422.5320822620004 3.3.3 0.857724 595.1307692307691 481.15333311488826 4.0.1a1 5.437302 11.669230769230769 358.5538653530674 2.4.2 6.039594 128.36153846153843 342.4299607843052 3.0.0 8.142923 245.05384615384614 286.1219306714863 3.1.0 8.145355 361.7461538461538 286.0568238198077 3.2.0 3.134423 478.4384615384615 420.20403043811984 3.3.3 0.931702 595.1307692307691 479.1728747787525 4.0.1a1 7.712221 11.669230769230769 297.652214895044 2.4.2 5.965445 128.36153846153843 344.41499694594967 3.0.0 8.065553 245.05384615384614 288.19319593233183 3.1.0 8.06323 361.7461538461538 288.255384754885 3.2.0 3.140944 478.4384615384615 420.0294573378746 3.3.3 0.925704 595.1307692307691 479.3334466933777 4.0.1a1 12.729495 11.669230769230769 163.33522716927052 2.4.2 16.356528 128.36153846153843 66.23625530885886 3.0.0 18.461486 245.05384615384614 9.884615384615415 3.1.0 18.446518 361.7461538461538 10.285322356624306 3.2.0 5.528239 478.4384615384615 356.11939916429264 3.3.3 4.221053 595.1307692307691 391.1139571488282 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_cisco_nxos.svg b/tests/performance/graphs/netmiko_cisco_nxos.svg
index 9999a33ca..01ae9b818 100644
--- a/tests/performance/graphs/netmiko_cisco_nxos.svg
+++ b/tests/performance/graphs/netmiko_cisco_nxos.svg
@@ -1,4 +1,4 @@
-Netmiko: Cisco NX-OS Performance (nx9k virtual) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 22 22 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0 Netmiko: Cisco NX-OS Performance (nx9k virtual) 4.987734 11.669230769230769 397.11574056421085 2.4.2 5.704003 108.91282051282049 381.7499395722393 3.0.0 7.65255 206.15641025641023 339.9486255051735 3.1.0 7.812037 303.4 336.5272216711299 3.2.0 7.945623 400.64358974358964 333.6614604957705 3.3.3 7.719243 497.88717948717954 338.5178901731159 3.4.0 5.363876 595.1307692307691 389.0465331620726 4.0.0 5.36276 11.669230769230769 389.0704742148154 2.4.2 6.289166 108.91282051282049 369.19669741619873 3.0.0 8.914154 206.15641025641023 312.88399476633754 3.1.0 8.36903 303.4 324.5782980238393 3.2.0 7.960268 400.64358974358964 333.3472878099116 3.3.3 8.21612 497.88717948717954 327.85860839561633 3.4.0 4.947016 595.1307692307691 397.9892457484239 4.0.0 7.674167 11.669230769230769 339.48488559734074 2.4.2 5.935209 108.91282051282049 376.7899798585706 3.0.0 7.975704 206.15641025641023 333.0161461520819 3.1.0 8.20709 303.4 328.05232497829337 3.2.0 8.498077 400.64358974358964 321.8099100011677 3.3.3 8.309425 497.88717948717954 325.8569776374013 3.4.0 5.532515 595.1307692307691 385.428795533493 4.0.0 15.172741 11.669230769230769 178.6213052838384 2.4.2 17.162782 108.91282051282049 135.92983884893187 3.0.0 21.243036 206.15641025641023 48.39796051733316 3.1.0 21.62422 303.4 40.22058932672786 3.2.0 22.775075 400.64358974358964 15.531807736828796 3.3.3 22.034908 497.88717948717954 31.41028191737354 3.4.0 23.038316 595.1307692307691 9.884615384615415 4.0.0 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Cisco NX-OS Performance (nx9k virtual) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 22 22 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.1a1 Netmiko: Cisco NX-OS Performance (nx9k virtual) 4.987734 11.669230769230769 395.87900728014154 2.4.2 5.704003 108.91282051282049 380.3356038513425 3.0.0 7.65255 206.15641025641023 338.0511379300533 3.1.0 7.812037 303.4 334.5901885065142 3.2.0 7.945623 400.64358974358964 331.69130402255706 3.3.3 7.719243 497.88717948717954 336.6038657391908 3.4.0 3.02668 595.1307692307691 438.43488149452185 4.0.1a1 5.36276 11.669230769230769 387.74075138146554 2.4.2 6.289166 108.91282051282049 367.6372676388214 3.0.0 8.914154 206.15641025641023 310.67368624725464 3.1.0 8.36903 303.4 322.5031556933993 3.2.0 7.960268 400.64358974358964 331.3735000366038 3.3.3 8.21612 497.88717948717954 325.8213808550322 3.4.0 3.264042 595.1307692307691 433.2840047643177 4.0.1a1 7.674167 11.669230769230769 337.58203798028535 2.4.2 5.935209 108.91282051282049 375.3183154678457 3.0.0 7.975704 206.15641025641023 331.0385309463221 3.1.0 8.20709 303.4 326.0173364708163 3.2.0 8.498077 400.64358974358964 319.70276982960206 3.3.3 8.309425 497.88717948717954 323.7966146611525 3.4.0 4.075294 595.1307692307691 415.6794216839107 4.0.1a1 15.172741 11.669230769230769 174.8591492014845 2.4.2 17.162782 108.91282051282049 131.6742422700795 3.0.0 21.243036 206.15641025641023 43.13064480324687 3.1.0 21.62422 303.4 34.85875715684125 3.2.0 22.775075 400.64358974358964 9.884615384615358 3.3.3 22.034908 497.88717948717954 25.946617629140633 3.4.0 20.931428 595.1307692307691 49.89269768511275 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_cisco_xe.svg b/tests/performance/graphs/netmiko_cisco_xe.svg
index ebad1ca5f..7b9e9a45c 100644
--- a/tests/performance/graphs/netmiko_cisco_xe.svg
+++ b/tests/performance/graphs/netmiko_cisco_xe.svg
@@ -1,4 +1,4 @@
-Netmiko: Cisco IOS-XE Performance (Cisco C1111-4P) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0 Netmiko: Cisco IOS-XE Performance (Cisco C1111-4P) 4.824338 11.669230769230769 375.7904172898143 2.4.2 5.340213 108.91282051282049 362.06840143622384 3.0.0 7.53684 206.15641025641023 303.63922669733415 3.1.0 7.527892 303.4 303.8772390023653 3.2.0 3.070582 400.64358974358964 422.43944590203483 3.3.3 3.067946 497.88717948717954 422.50956217785756 3.4.0 3.077292 595.1307692307691 422.2609632727591 4.0.0 5.343782 11.669230769230769 361.9734678290875 2.4.2 5.961108 108.91282051282049 345.5529063387389 3.0.0 7.961087 206.15641025641023 292.3544696150213 3.1.0 7.963046 303.4 292.30236119911194 3.2.0 3.149141 400.64358974358964 420.3498159656312 3.3.3 2.977177 497.88717948717954 424.92397198064805 3.4.0 2.965434 595.1307692307691 425.23632988162933 4.0.0 7.53803 11.669230769230769 303.60757329512285 2.4.2 5.810182 108.91282051282049 349.5674621220566 3.0.0 7.810232 206.15641025641023 296.36713683400524 3.1.0 7.80769 303.4 296.4347527570483 3.2.0 3.024375 400.64358974358964 423.6685288902526 3.3.3 3.222384 497.88717948717954 418.40158895877005 3.4.0 3.015565 595.1307692307691 423.9028704646071 4.0.0 15.060866 11.669230769230769 103.50391474225512 2.4.2 16.613027 108.91282051282049 62.21721186011371 3.0.0 18.580455 206.15641025641023 9.884615384615415 3.1.0 18.531863 303.4 11.17713817474413 3.2.0 8.902653 400.64358974358964 267.3092870045018 3.3.3 10.138406 497.88717948717954 234.43887797688484 3.4.0 10.685372 595.1307692307691 219.88985714165364 4.0.0 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Cisco IOS-XE Performance (Cisco C1111-4P) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.1a1 Netmiko: Cisco IOS-XE Performance (Cisco C1111-4P) 4.824338 11.669230769230769 375.7904172898143 2.4.2 5.340213 108.91282051282049 362.06840143622384 3.0.0 7.53684 206.15641025641023 303.63922669733415 3.1.0 7.527892 303.4 303.8772390023653 3.2.0 3.070582 400.64358974358964 422.43944590203483 3.3.3 3.067946 497.88717948717954 422.50956217785756 3.4.0 0.763497 595.1307692307691 483.8067479530755 4.0.1a1 5.343782 11.669230769230769 361.9734678290875 2.4.2 5.961108 108.91282051282049 345.5529063387389 3.0.0 7.961087 206.15641025641023 292.3544696150213 3.1.0 7.963046 303.4 292.30236119911194 3.2.0 3.149141 400.64358974358964 420.3498159656312 3.3.3 2.977177 497.88717948717954 424.92397198064805 3.4.0 1.044846 595.1307692307691 476.32300588689316 4.0.1a1 7.53803 11.669230769230769 303.60757329512285 2.4.2 5.810182 108.91282051282049 349.5674621220566 3.0.0 7.810232 206.15641025641023 296.36713683400524 3.1.0 7.80769 303.4 296.4347527570483 3.2.0 3.024375 400.64358974358964 423.6685288902526 3.3.3 3.222384 497.88717948717954 418.40158895877005 3.4.0 0.943925 595.1307692307691 479.0074537898933 4.0.1a1 15.060866 11.669230769230769 103.50391474225512 2.4.2 16.613027 108.91282051282049 62.21721186011371 3.0.0 18.580455 206.15641025641023 9.884615384615415 3.1.0 18.531863 303.4 11.17713817474413 3.2.0 8.902653 400.64358974358964 267.3092870045018 3.3.3 10.138406 497.88717948717954 234.43887797688484 3.4.0 7.006885 595.1307692307691 317.73576347792925 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_cisco_xr.svg b/tests/performance/graphs/netmiko_cisco_xr.svg
index 2c2a1d29d..08a999202 100644
--- a/tests/performance/graphs/netmiko_cisco_xr.svg
+++ b/tests/performance/graphs/netmiko_cisco_xr.svg
@@ -1,4 +1,4 @@
-Netmiko: Cisco IOS-XR Performance (cisco IOS-XRv 9000) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0 Netmiko: Cisco IOS-XR Performance (cisco IOS-XRv 9000) 5.733791 11.669230769230769 363.8521727326825 2.4.2 6.266681 108.91282051282049 350.8163186214718 3.0.0 6.264205 206.15641025641023 350.8768879224145 3.1.0 6.273295 303.4 350.654523243267 3.2.0 8.140628 400.64358974358964 304.9747758938149 3.3.3 8.07315 497.88717948717954 306.6254605824304 3.4.0 2.767007 595.1307692307691 436.4273071947183 4.0.0 6.0824 11.669230769230769 355.3243038181691 2.4.2 6.900057 108.91282051282049 335.32231960940135 3.0.0 6.999404 206.15641025641023 332.8920375654777 3.1.0 6.88443 303.4 335.70459604955954 3.2.0 8.500045 400.64358974358964 296.18251562042076 3.3.3 8.433702 497.88717948717954 297.805435302344 3.4.0 2.512359 595.1307692307691 442.65664941865117 4.0.0 13.662819 11.669230769230769 169.88784191073972 2.4.2 11.732624 108.91282051282049 217.10535476740517 3.0.0 12.024759 206.15641025641023 209.9589845206778 3.1.0 11.881486 303.4 213.46380901743225 3.2.0 9.143244 400.64358974358964 280.4482208720175 3.3.3 9.295759 497.88717948717954 276.71731338684924 3.4.0 3.235152 595.1307692307691 424.97528159301294 4.0.0 18.556989 11.669230769230769 50.16390992578181 2.4.2 19.812287 108.91282051282049 19.456106074903346 3.0.0 19.590199 206.15641025641023 24.88894731390309 3.1.0 20.203558 303.4 9.884615384615358 3.2.0 16.494184 400.64358974358964 100.6254029916604 3.3.3 17.251342 497.88717948717954 82.10337925855214 3.4.0 11.773506 595.1307692307691 216.10527635014358 4.0.0 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Cisco IOS-XR Performance (cisco IOS-XRv 9000) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.1a1 Netmiko: Cisco IOS-XR Performance (cisco IOS-XRv 9000) 5.733791 11.669230769230769 363.8521727326825 2.4.2 6.266681 108.91282051282049 350.8163186214718 3.0.0 6.264205 206.15641025641023 350.8768879224145 3.1.0 6.273295 303.4 350.654523243267 3.2.0 8.140628 400.64358974358964 304.9747758938149 3.3.3 8.07315 497.88717948717954 306.6254605824304 3.4.0 2.203243 595.1307692307691 450.2184184130797 4.0.1a1 6.0824 11.669230769230769 355.3243038181691 2.4.2 6.900057 108.91282051282049 335.32231960940135 3.0.0 6.999404 206.15641025641023 332.8920375654777 3.1.0 6.88443 303.4 335.70459604955954 3.2.0 8.500045 400.64358974358964 296.18251562042076 3.3.3 8.433702 497.88717948717954 297.805435302344 3.4.0 2.434539 595.1307692307691 444.5603259127389 4.0.1a1 13.662819 11.669230769230769 169.88784191073972 2.4.2 11.732624 108.91282051282049 217.10535476740517 3.0.0 12.024759 206.15641025641023 209.9589845206778 3.1.0 11.881486 303.4 213.46380901743225 3.2.0 9.143244 400.64358974358964 280.4482208720175 3.3.3 9.295759 497.88717948717954 276.71731338684924 3.4.0 3.168557 595.1307692307691 426.60436584029867 4.0.1a1 18.556989 11.669230769230769 50.16390992578181 2.4.2 19.812287 108.91282051282049 19.456106074903346 3.0.0 19.590199 206.15641025641023 24.88894731390309 3.1.0 20.203558 303.4 9.884615384615358 3.2.0 16.494184 400.64358974358964 100.6254029916604 3.3.3 17.251342 497.88717948717954 82.10337925855214 3.4.0 12.212727 595.1307692307691 205.36080586171244 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_hp_procurve.svg b/tests/performance/graphs/netmiko_hp_procurve.svg
index 47f7a251d..582fd551d 100644
--- a/tests/performance/graphs/netmiko_hp_procurve.svg
+++ b/tests/performance/graphs/netmiko_hp_procurve.svg
@@ -1,10 +1,4 @@
-<<<<<<< Updated upstream
-Netmiko: HPE ProCurve Performance 0 0 10 10 20 20 30 30 40 40 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0a4 Netmiko: HPE ProCurve Performance 11.258269 11.669230769230769 373.59571295030594 2.4.2 17.901763 108.91282051282049 296.57617685741997 3.0.0 18.419321 206.15641025641023 290.57600931588803 3.1.0 18.353988 303.4 291.3334296359119 3.2.0 18.020695 400.64358974358964 295.19737114666003 3.3.3 18.010017 497.88717948717954 295.32116362790555 3.4.0 2.184035 595.1307692307691 478.7953704013842 4.0.0a4 21.831155 11.669230769230769 251.0218422005214 2.4.2 22.221532 108.91282051282049 246.49611290185226 3.0.0 22.93706 206.15641025641023 238.20083414921538 3.1.0 22.718488 303.4 240.73478902941758 3.2.0 22.391657 400.64358974358964 244.52381510527078 3.3.3 22.410676 497.88717948717954 244.3033235150096 3.4.0 2.524702 595.1307692307691 474.84594043243186 4.0.0a4 32.216741 11.669230769230769 130.61938292641474 2.4.2 30.53423 108.91282051282049 150.12511540561582 3.0.0 31.002139 206.15641025641023 144.70054000693466 3.1.0 30.893432 303.4 145.96080496842166 3.2.0 30.752905 400.64358974358964 147.58996642300042 3.3.3 30.529921 497.88717948717954 150.17507062210643 3.4.0 2.561778 595.1307692307691 474.41610993658435 4.0.0a4 42.488945 11.669230769230769 11.531386951482148 2.4.2 42.045111 108.91282051282049 16.67685540260902 3.0.0 42.630991 206.15641025641023 9.884615384615415 3.1.0 42.584148 303.4 10.427676931626536 3.2.0 42.227986 400.64358974358964 14.556743957789934 3.3.3 42.211889 497.88717948717954 14.743360137843297 3.4.0 10.813657 595.1307692307691 378.7502009322821 4.0.0a4 Connect Show Command Simple Config Large ACL
-=======
-Netmiko: HPE ProCurve Performance 0 0 10 10 20 20 30 30 40 40 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.1a1 Netmiko: HPE ProCurve Performance 11.258269 11.669230769230769 373.59571295030594 2.4.2 17.901763 108.91282051282049 296.57617685741997 3.0.0 18.419321 206.15641025641023 290.57600931588803 3.1.0 18.353988 303.4 291.3334296359119 3.2.0 18.020695 400.64358974358964 295.19737114666003 3.3.3 18.010017 497.88717948717954 295.32116362790555 3.4.0 1.971205 595.1307692307691 481.26275697035663 4.0.1a1 21.831155 11.669230769230769 251.0218422005214 2.4.2 22.221532 108.91282051282049 246.49611290185226 3.0.0 22.93706 206.15641025641023 238.20083414921538 3.1.0 22.718488 303.4 240.73478902941758 3.2.0 22.391657 400.64358974358964 244.52381510527078 3.3.3 22.410676 497.88717948717954 244.3033235150096 3.4.0 2.301713 595.1307692307691 477.4311025976745 4.0.1a1 32.216741 11.669230769230769 130.61938292641474 2.4.2 30.53423 108.91282051282049 150.12511540561582 3.0.0 31.002139 206.15641025641023 144.70054000693466 3.1.0 30.893432 303.4 145.96080496842166 3.2.0 30.752905 400.64358974358964 147.58996642300042 3.3.3 30.529921 497.88717948717954 150.17507062210643 3.4.0 2.163165 595.1307692307691 479.0373210554013 4.0.1a1 42.488945 11.669230769230769 11.531386951482148 2.4.2 42.045111 108.91282051282049 16.67685540260902 3.0.0 42.630991 206.15641025641023 9.884615384615415 3.1.0 42.584148 303.4 10.427676931626536 3.2.0 42.227986 400.64358974358964 14.556743957789934 3.3.3 42.211889 497.88717948717954 14.743360137843297 3.4.0 10.581683 595.1307692307691 381.43952824492976 4.0.1a1 Connect Show Command Simple Config Large ACL
->>>>>>> Stashed changes
+Netmiko: HPE ProCurve Performance 0 0 10 10 20 20 30 30 40 40 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.1a1 Netmiko: HPE ProCurve Performance 11.258269 11.669230769230769 373.59571295030594 2.4.2 17.901763 108.91282051282049 296.57617685741997 3.0.0 18.419321 206.15641025641023 290.57600931588803 3.1.0 18.353988 303.4 291.3334296359119 3.2.0 18.020695 400.64358974358964 295.19737114666003 3.3.3 18.010017 497.88717948717954 295.32116362790555 3.4.0 1.97346 595.1307692307691 481.2366142427664 4.0.1a1 21.831155 11.669230769230769 251.0218422005214 2.4.2 22.221532 108.91282051282049 246.49611290185226 3.0.0 22.93706 206.15641025641023 238.20083414921538 3.1.0 22.718488 303.4 240.73478902941758 3.2.0 22.391657 400.64358974358964 244.52381510527078 3.3.3 22.410676 497.88717948717954 244.3033235150096 3.4.0 2.218327 595.1307692307691 478.39781545037545 4.0.1a1 32.216741 11.669230769230769 130.61938292641474 2.4.2 30.53423 108.91282051282049 150.12511540561582 3.0.0 31.002139 206.15641025641023 144.70054000693466 3.1.0 30.893432 303.4 145.96080496842166 3.2.0 30.752905 400.64358974358964 147.58996642300042 3.3.3 30.529921 497.88717948717954 150.17507062210643 3.4.0 2.201625 595.1307692307691 478.59144553295295 4.0.1a1 42.488945 11.669230769230769 11.531386951482148 2.4.2 42.045111 108.91282051282049 16.67685540260902 3.0.0 42.630991 206.15641025641023 9.884615384615415 3.1.0 42.584148 303.4 10.427676931626536 3.2.0 42.227986 400.64358974358964 14.556743957789934 3.3.3 42.211889 497.88717948717954 14.743360137843297 3.4.0 10.596277 595.1307692307691 381.2703366855275 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_juniper_junos.svg b/tests/performance/graphs/netmiko_juniper_junos.svg
index 0886e674a..54805f1e3 100644
--- a/tests/performance/graphs/netmiko_juniper_junos.svg
+++ b/tests/performance/graphs/netmiko_juniper_junos.svg
@@ -1,4 +1,4 @@
-Netmiko: Juniper Junos Performance 0 0 4 4 8 8 12 12 16 16 20 20 24 24 28 28 32 32 36 36 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.0 Netmiko: Juniper Junos Performance 6.955827 11.669230769230769 413.13380793339843 2.4.2 8.245966 108.91282051282049 396.2589086067014 3.0.0 7.763991 206.15641025641023 402.5630972274506 3.1.0 7.762834 303.4 402.5782306809165 3.2.0 3.517362 400.64358974358964 458.10861352672697 3.3.3 3.991287 497.88717948717954 451.90971816475053 3.4.0 5.92602 595.1307692307691 426.60358867092197 4.0.0 7.795193 11.669230769230769 402.1549779404656 2.4.2 8.638104 108.91282051282049 391.1297796739489 3.0.0 8.640627 206.15641025641023 391.0967790662615 3.1.0 8.832251 303.4 388.590354790599 3.2.0 4.262974 400.64358974358964 448.3560772211217 3.3.3 4.1622 497.88717948717954 449.6741918620624 3.4.0 6.641656 595.1307692307691 417.24313568518926 4.0.0 20.183726 11.669230769230769 240.1141070106945 2.4.2 18.754187 108.91282051282049 258.8123455017309 3.0.0 18.747711 206.15641025641023 258.89705098543436 3.1.0 18.852219 303.4 257.53009596831254 3.2.0 14.697604 400.64358974358964 311.87207762004573 3.3.3 16.79162 497.88717948717954 284.48254115266286 3.4.0 17.185611 595.1307692307691 279.3291751505308 4.0.0 35.183576 11.669230769230769 43.91745016553557 2.4.2 37.204469 108.91282051282049 17.484355805139785 3.0.0 37.257378 206.15641025641023 16.792310956889935 3.1.0 37.785493 303.4 9.884615384615415 3.2.0 29.58927 400.64358974358964 117.09045753353024 3.3.3 27.660851 497.88717948717954 142.3140004887387 3.4.0 32.165569 595.1307692307691 83.39270383375816 4.0.0 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Juniper Junos Performance 0 0 4 4 8 8 12 12 16 16 20 20 24 24 28 28 32 32 36 36 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.1a1 Netmiko: Juniper Junos Performance 6.955827 11.669230769230769 413.13380793339843 2.4.2 8.245966 108.91282051282049 396.2589086067014 3.0.0 7.763991 206.15641025641023 402.5630972274506 3.1.0 7.762834 303.4 402.5782306809165 3.2.0 3.517362 400.64358974358964 458.10861352672697 3.3.3 3.991287 497.88717948717954 451.90971816475053 3.4.0 3.311785 595.1307692307691 460.7975417576264 4.0.1a1 7.795193 11.669230769230769 402.1549779404656 2.4.2 8.638104 108.91282051282049 391.1297796739489 3.0.0 8.640627 206.15641025641023 391.0967790662615 3.1.0 8.832251 303.4 388.590354790599 3.2.0 4.262974 400.64358974358964 448.3560772211217 3.3.3 4.1622 497.88717948717954 449.6741918620624 3.4.0 4.06215 595.1307692307691 450.9828366496675 4.0.1a1 20.183726 11.669230769230769 240.1141070106945 2.4.2 18.754187 108.91282051282049 258.8123455017309 3.0.0 18.747711 206.15641025641023 258.89705098543436 3.1.0 18.852219 303.4 257.53009596831254 3.2.0 14.697604 400.64358974358964 311.87207762004573 3.3.3 16.79162 497.88717948717954 284.48254115266286 3.4.0 3.734963 595.1307692307691 455.2624124829723 4.0.1a1 35.183576 11.669230769230769 43.91745016553557 2.4.2 37.204469 108.91282051282049 17.484355805139785 3.0.0 37.257378 206.15641025641023 16.792310956889935 3.1.0 37.785493 303.4 9.884615384615415 3.2.0 29.58927 400.64358974358964 117.09045753353024 3.3.3 27.660851 497.88717948717954 142.3140004887387 3.4.0 17.751708 595.1307692307691 271.92467851555955 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/netmiko_performance.csv b/tests/performance/netmiko_performance.csv
index ee62f729f..9b41cd997 100644
--- a/tests/performance/netmiko_performance.csv
+++ b/tests/performance/netmiko_performance.csv
@@ -60,4 +60,11 @@ date,netmiko_version,device_name,connect,send_command_simple,send_config_simple,
2022-3-23 14:33:38,4.0.0,arista1,0:00:01.687836,0:00:02.167681,0:00:03.117634,0:00:21.231472
2022-3-23 14:34:57,4.0.0,juniper_vmx,0:00:05.926020,0:00:06.641656,0:00:17.185611,0:00:32.165569
2022-3-23 14:35:27,4.0.0,cisco_asa,0:00:05.193105,0:00:04.572510,0:00:05.568892,0:00:09.710037
-2022-3-23 20:55:6,4.0.1a1,hp_procurve,0:00:01.971205,0:00:02.301713,0:00:02.163165,0:00:10.581683
+2022-4-26 13:45:1,4.0.1a1,cisco1,0:00:00.857724,0:00:00.931702,0:00:00.925704,0:00:04.221053
+2022-4-26 13:45:12,4.0.1a1,cisco3,0:00:00.763497,0:00:01.044846,0:00:00.943925,0:00:07.006885
+2022-4-26 13:45:28,4.0.1a1,cisco5,0:00:01.400548,0:00:01.111659,0:00:01.537387,0:00:10.841677
+2022-4-26 13:46:4,4.0.1a1,nxos1,0:00:03.026680,0:00:03.264042,0:00:04.075294,0:00:20.931428
+2022-4-26 13:46:27,4.0.1a1,cisco_xr_azure,0:00:02.203243,0:00:02.434539,0:00:03.168557,0:00:12.212727
+2022-4-26 13:46:57,4.0.1a1,arista1,0:00:01.705048,0:00:02.553805,0:00:02.970468,0:00:20.467766
+2022-4-26 13:47:30,4.0.1a1,juniper_vmx,0:00:03.311785,0:00:04.062150,0:00:03.734963,0:00:17.751708
+2022-4-26 13:50:17,4.0.1a1,hp_procurve,0:00:01.973460,0:00:02.218327,0:00:02.201625,0:00:10.596277
diff --git a/tests/performance/performance_report.md b/tests/performance/performance_report.md
index b527ca8d7..e4fff7b9c 100644
--- a/tests/performance/performance_report.md
+++ b/tests/performance/performance_report.md
@@ -1,10 +1,10 @@
# Netmiko performance
![](graphs/netmiko_arista_eos.svg)
-![](graphs/netmiko_cisco_asa.svg)
+![](graphs/netmiko_cisco_xr.svg)
+![](graphs/netmiko_cisco_xe.svg)
![](graphs/netmiko_cisco_ios.svg)
+![](graphs/netmiko_cisco_asa.svg)
+![](graphs/netmiko_juniper_junos.svg)
![](graphs/netmiko_cisco_nxos.svg)
-![](graphs/netmiko_cisco_xe.svg)
-![](graphs/netmiko_cisco_xr.svg)
-![](graphs/netmiko_hp_procurve.svg)
-![](graphs/netmiko_juniper_junos.svg)
\ No newline at end of file
+![](graphs/netmiko_hp_procurve.svg)
\ No newline at end of file
From 3ad6c6e07da753ff6ac81ede004acc52975f620c Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Tue, 26 Apr 2022 14:13:28 -0700
Subject: [PATCH 25/29] Update performance results (#2761)
---
tests/performance/gen_graph.py | 4 ++--
tests/performance/graphs/netmiko_arista_eos.svg | 6 +++---
tests/performance/graphs/netmiko_cisco_ios.svg | 6 +++---
tests/performance/graphs/netmiko_cisco_nxos.svg | 6 +++---
tests/performance/graphs/netmiko_cisco_xe.svg | 6 +++---
tests/performance/graphs/netmiko_cisco_xr.svg | 6 +++---
tests/performance/graphs/netmiko_hp_procurve.svg | 6 +++---
.../performance/graphs/netmiko_juniper_junos.svg | 6 +++---
tests/performance/netmiko_performance.csv | 16 ++++++++--------
tests/performance/test_netmiko.py | 2 +-
10 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/tests/performance/gen_graph.py b/tests/performance/gen_graph.py
index e7ac2a1d8..f16e55e18 100644
--- a/tests/performance/gen_graph.py
+++ b/tests/performance/gen_graph.py
@@ -55,7 +55,7 @@ def generate_graph(device_name: str, params: Dict) -> None:
device_type = device_dict["device_type"]
outfile = f"netmiko_{device_type}.svg"
entries = read_csv(device)
- entries = filter_versions(entries)
+ # entries = filter_versions(entries)
# Create relevant lists
netmiko_versions = [v["netmiko_version"] for v in entries]
@@ -101,7 +101,7 @@ def generate_report():
if __name__ == "__main__":
f_name = os.environ.get("TEST_DEVICES", "test_devices.yml")
with open(f_name) as f:
- devices = yaml.load(f)
+ devices = yaml.safe_load(f)
for device_name, device in devices.items():
if "graph" in device:
generate_graph(device_name, device)
diff --git a/tests/performance/graphs/netmiko_arista_eos.svg b/tests/performance/graphs/netmiko_arista_eos.svg
index cdde78f6e..cf5bbca2a 100644
--- a/tests/performance/graphs/netmiko_arista_eos.svg
+++ b/tests/performance/graphs/netmiko_arista_eos.svg
@@ -1,4 +1,4 @@
-Netmiko: Arista EOS Performance (vEOS) 0 0 10 10 20 20 30 30 40 40 50 50 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.1a1 Netmiko: Arista EOS Performance (vEOS) 5.600851 11.669230769230769 455.2731705209025 2.4.2 6.21565 108.91282051282049 449.9118166153846 3.0.0 6.25804 206.15641025641023 449.54215467375025 3.1.0 8.236209 303.4 432.2915343996048 3.2.0 1.904317 400.64358974358964 487.50879061426554 3.3.3 2.280802 497.88717948717954 484.22565364572966 3.4.0 1.705048 595.1307692307691 489.246515677902 4.0.1a1 6.615937 11.669230769230769 446.42111433581357 2.4.2 6.971088 108.91282051282049 443.32402048741994 3.0.0 6.7046 206.15641025641023 445.6479287559331 3.1.0 8.897231 303.4 426.52709288077796 3.2.0 2.497181 400.64358974358964 482.3387208486333 3.3.3 2.81286 497.88717948717954 479.5858425265476 3.4.0 2.553805 595.1307692307691 481.8449313279183 4.0.1a1 8.651368 11.669230769230769 428.6711408627564 2.4.2 7.130959 108.91282051282049 441.92986563318453 3.0.0 7.223195 206.15641025641023 441.1255217113022 3.1.0 17.371332 303.4 352.6287057784849 3.2.0 3.357669 400.64358974358964 474.83483632791797 3.3.3 2.930811 497.88717948717954 478.55725097953837 3.4.0 2.970468 595.1307692307691 478.2114221609633 4.0.1a1 17.739594 11.669230769230769 349.417277471097 2.4.2 34.856952 108.91282051282049 200.14537858146457 3.0.0 34.630821 206.15641025641023 202.11735368228398 3.1.0 56.674599 303.4 9.884615384615415 3.2.0 32.008313 400.64358974358964 224.98693139475876 3.3.3 30.11219 497.88717948717954 241.52206962919348 3.4.0 20.467766 595.1307692307691 325.6262569796446 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Arista EOS Performance (vEOS) 0 0 10 10 20 20 30 30 40 40 50 50 2.4.2 3.0.0 3.1.0 3.3.3 3.4.0 3.2.0 4.0.0 4.0.1a1 Netmiko: Arista EOS Performance (vEOS) 5.600851 11.669230769230769 455.2731705209025 2.4.2 6.21565 95.0208791208791 449.9118166153846 3.0.0 6.25804 178.37252747252745 449.54215467375025 3.1.0 1.904317 261.7241758241758 487.50879061426554 3.3.3 2.280802 345.0758241758241 484.22565364572966 3.4.0 8.236209 428.4274725274725 432.2915343996048 3.2.0 1.687836 511.77912087912074 489.39661290223347 4.0.0 1.841382 595.1307692307691 488.05761520253543 4.0.1a1 6.615937 11.669230769230769 446.42111433581357 2.4.2 6.971088 95.0208791208791 443.32402048741994 3.0.0 6.7046 178.37252747252745 445.6479287559331 3.1.0 2.497181 261.7241758241758 482.3387208486333 3.3.3 2.81286 345.0758241758241 479.5858425265476 3.4.0 8.897231 428.4274725274725 426.52709288077796 3.2.0 2.167681 511.77912087912074 485.21212518381947 4.0.0 1.905576 595.1307692307691 487.4978115063505 4.0.1a1 8.651368 11.669230769230769 428.6711408627564 2.4.2 7.130959 95.0208791208791 441.92986563318453 3.0.0 7.223195 178.37252747252745 441.1255217113022 3.1.0 3.357669 261.7241758241758 474.83483632791797 3.3.3 2.930811 345.0758241758241 478.55725097953837 3.4.0 17.371332 428.4274725274725 352.6287057784849 3.2.0 3.117634 511.77912087912074 476.92806124323334 4.0.0 3.065721 595.1307692307691 477.3807684943791 4.0.1a1 17.739594 11.669230769230769 349.417277471097 2.4.2 34.856952 95.0208791208791 200.14537858146457 3.0.0 34.630821 178.37252747252745 202.11735368228398 3.1.0 32.008313 261.7241758241758 224.98693139475876 3.3.3 30.11219 345.0758241758241 241.52206962919348 3.4.0 56.674599 428.4274725274725 9.884615384615415 3.2.0 21.231472 511.77912087912074 318.96635976808864 4.0.0 23.224994 595.1307692307691 301.5818536767714 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_cisco_ios.svg b/tests/performance/graphs/netmiko_cisco_ios.svg
index ede7ebc33..0c1ec4a86 100644
--- a/tests/performance/graphs/netmiko_cisco_ios.svg
+++ b/tests/performance/graphs/netmiko_cisco_ios.svg
@@ -1,4 +1,4 @@
-Netmiko: Cisco IOS Performance (Cisco 881) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 4.0.1a1 Netmiko: Cisco IOS Performance (Cisco 881) 5.015699 11.669230769230769 369.8405610719277 2.4.2 5.692225 128.36153846153843 351.7293448142215 3.0.0 7.7883 245.05384615384614 295.6155108782434 3.1.0 7.71581 361.7461538461538 297.55613410118104 3.2.0 3.047461 478.4384615384615 422.5320822620004 3.3.3 0.857724 595.1307692307691 481.15333311488826 4.0.1a1 5.437302 11.669230769230769 358.5538653530674 2.4.2 6.039594 128.36153846153843 342.4299607843052 3.0.0 8.142923 245.05384615384614 286.1219306714863 3.1.0 8.145355 361.7461538461538 286.0568238198077 3.2.0 3.134423 478.4384615384615 420.20403043811984 3.3.3 0.931702 595.1307692307691 479.1728747787525 4.0.1a1 7.712221 11.669230769230769 297.652214895044 2.4.2 5.965445 128.36153846153843 344.41499694594967 3.0.0 8.065553 245.05384615384614 288.19319593233183 3.1.0 8.06323 361.7461538461538 288.255384754885 3.2.0 3.140944 478.4384615384615 420.0294573378746 3.3.3 0.925704 595.1307692307691 479.3334466933777 4.0.1a1 12.729495 11.669230769230769 163.33522716927052 2.4.2 16.356528 128.36153846153843 66.23625530885886 3.0.0 18.461486 245.05384615384614 9.884615384615415 3.1.0 18.446518 361.7461538461538 10.285322356624306 3.2.0 5.528239 478.4384615384615 356.11939916429264 3.3.3 4.221053 595.1307692307691 391.1139571488282 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Cisco IOS Performance (Cisco 881) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 2.4.2 3.0.0 3.1.0 3.3.3 3.2.0 4.0.0 4.0.1a1 Netmiko: Cisco IOS Performance (Cisco 881) 5.015699 11.669230769230769 369.8405610719277 2.4.2 5.692225 108.91282051282049 351.7293448142215 3.0.0 7.7883 206.15641025641023 295.6155108782434 3.1.0 3.047461 303.4 422.5320822620004 3.3.3 7.71581 400.64358974358964 297.55613410118104 3.2.0 3.050436 497.88717948717954 422.4524388065136 4.0.0 1.06331 595.1307692307691 475.64960893347205 4.0.1a1 5.437302 11.669230769230769 358.5538653530674 2.4.2 6.039594 108.91282051282049 342.4299607843052 3.0.0 8.142923 206.15641025641023 286.1219306714863 3.1.0 3.134423 303.4 420.20403043811984 3.3.3 8.145355 400.64358974358964 286.0568238198077 3.2.0 3.110452 497.88717948717954 420.845755907523 4.0.0 1.119291 595.1307692307691 474.1509466539401 4.0.1a1 7.712221 11.669230769230769 297.652214895044 2.4.2 5.965445 108.91282051282049 344.41499694594967 3.0.0 8.065553 206.15641025641023 288.19319593233183 3.1.0 3.140944 303.4 420.0294573378746 3.3.3 8.06323 400.64358974358964 288.255384754885 3.2.0 3.111018 497.88717948717954 420.8306035727985 4.0.0 1.125631 595.1307692307691 473.98121908829756 4.0.1a1 12.729495 11.669230769230769 163.33522716927052 2.4.2 16.356528 108.91282051282049 66.23625530885886 3.0.0 18.461486 206.15641025641023 9.884615384615415 3.1.0 5.528239 303.4 356.11939916429264 3.3.3 18.446518 400.64358974358964 10.285322356624306 3.2.0 6.266658 497.88717948717954 336.3512510106383 4.0.0 4.039539 595.1307692307691 395.9732519989911 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_cisco_nxos.svg b/tests/performance/graphs/netmiko_cisco_nxos.svg
index 01ae9b818..4c0951b90 100644
--- a/tests/performance/graphs/netmiko_cisco_nxos.svg
+++ b/tests/performance/graphs/netmiko_cisco_nxos.svg
@@ -1,4 +1,4 @@
-Netmiko: Cisco NX-OS Performance (nx9k virtual) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 22 22 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.1a1 Netmiko: Cisco NX-OS Performance (nx9k virtual) 4.987734 11.669230769230769 395.87900728014154 2.4.2 5.704003 108.91282051282049 380.3356038513425 3.0.0 7.65255 206.15641025641023 338.0511379300533 3.1.0 7.812037 303.4 334.5901885065142 3.2.0 7.945623 400.64358974358964 331.69130402255706 3.3.3 7.719243 497.88717948717954 336.6038657391908 3.4.0 3.02668 595.1307692307691 438.43488149452185 4.0.1a1 5.36276 11.669230769230769 387.74075138146554 2.4.2 6.289166 108.91282051282049 367.6372676388214 3.0.0 8.914154 206.15641025641023 310.67368624725464 3.1.0 8.36903 303.4 322.5031556933993 3.2.0 7.960268 400.64358974358964 331.3735000366038 3.3.3 8.21612 497.88717948717954 325.8213808550322 3.4.0 3.264042 595.1307692307691 433.2840047643177 4.0.1a1 7.674167 11.669230769230769 337.58203798028535 2.4.2 5.935209 108.91282051282049 375.3183154678457 3.0.0 7.975704 206.15641025641023 331.0385309463221 3.1.0 8.20709 303.4 326.0173364708163 3.2.0 8.498077 400.64358974358964 319.70276982960206 3.3.3 8.309425 497.88717948717954 323.7966146611525 3.4.0 4.075294 595.1307692307691 415.6794216839107 4.0.1a1 15.172741 11.669230769230769 174.8591492014845 2.4.2 17.162782 108.91282051282049 131.6742422700795 3.0.0 21.243036 206.15641025641023 43.13064480324687 3.1.0 21.62422 303.4 34.85875715684125 3.2.0 22.775075 400.64358974358964 9.884615384615358 3.3.3 22.034908 497.88717948717954 25.946617629140633 3.4.0 20.931428 595.1307692307691 49.89269768511275 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Cisco NX-OS Performance (nx9k virtual) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 22 22 2.4.2 3.0.0 3.1.0 3.3.3 3.4.0 3.2.0 4.0.0 4.0.1a1 Netmiko: Cisco NX-OS Performance (nx9k virtual) 4.987734 11.669230769230769 397.11574056421085 2.4.2 5.704003 95.0208791208791 381.7499395722393 3.0.0 7.65255 178.37252747252745 339.9486255051735 3.1.0 7.945623 261.7241758241758 333.6614604957705 3.3.3 7.719243 345.0758241758241 338.5178901731159 3.4.0 7.812037 428.4274725274725 336.5272216711299 3.2.0 5.363876 511.77912087912074 389.0465331620726 4.0.0 3.239731 595.1307692307691 434.6148731964611 4.0.1a1 5.36276 11.669230769230769 389.0704742148154 2.4.2 6.289166 95.0208791208791 369.19669741619873 3.0.0 8.914154 178.37252747252745 312.88399476633754 3.1.0 7.960268 261.7241758241758 333.3472878099116 3.3.3 8.21612 345.0758241758241 327.85860839561633 3.4.0 8.36903 428.4274725274725 324.5782980238393 3.2.0 4.947016 511.77912087912074 397.9892457484239 4.0.0 3.440601 595.1307692307691 430.3056982283174 4.0.1a1 7.674167 11.669230769230769 339.48488559734074 2.4.2 5.935209 95.0208791208791 376.7899798585706 3.0.0 7.975704 178.37252747252745 333.0161461520819 3.1.0 8.498077 261.7241758241758 321.8099100011677 3.3.3 8.309425 345.0758241758241 325.8569776374013 3.4.0 8.20709 428.4274725274725 328.05232497829337 3.2.0 5.532515 511.77912087912074 385.428795533493 4.0.0 4.322041 595.1307692307691 411.3965570727412 4.0.1a1 15.172741 11.669230769230769 178.6213052838384 2.4.2 17.162782 95.0208791208791 135.92983884893187 3.0.0 21.243036 178.37252747252745 48.39796051733316 3.1.0 22.775075 261.7241758241758 15.531807736828796 3.3.3 22.034908 345.0758241758241 31.41028191737354 3.4.0 21.62422 428.4274725274725 40.22058932672786 3.2.0 23.038316 511.77912087912074 9.884615384615415 4.0.0 20.021282 595.1307692307691 74.60770689075605 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_cisco_xe.svg b/tests/performance/graphs/netmiko_cisco_xe.svg
index 7b9e9a45c..5f1d8686c 100644
--- a/tests/performance/graphs/netmiko_cisco_xe.svg
+++ b/tests/performance/graphs/netmiko_cisco_xe.svg
@@ -1,4 +1,4 @@
-Netmiko: Cisco IOS-XE Performance (Cisco C1111-4P) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.1a1 Netmiko: Cisco IOS-XE Performance (Cisco C1111-4P) 4.824338 11.669230769230769 375.7904172898143 2.4.2 5.340213 108.91282051282049 362.06840143622384 3.0.0 7.53684 206.15641025641023 303.63922669733415 3.1.0 7.527892 303.4 303.8772390023653 3.2.0 3.070582 400.64358974358964 422.43944590203483 3.3.3 3.067946 497.88717948717954 422.50956217785756 3.4.0 0.763497 595.1307692307691 483.8067479530755 4.0.1a1 5.343782 11.669230769230769 361.9734678290875 2.4.2 5.961108 108.91282051282049 345.5529063387389 3.0.0 7.961087 206.15641025641023 292.3544696150213 3.1.0 7.963046 303.4 292.30236119911194 3.2.0 3.149141 400.64358974358964 420.3498159656312 3.3.3 2.977177 497.88717948717954 424.92397198064805 3.4.0 1.044846 595.1307692307691 476.32300588689316 4.0.1a1 7.53803 11.669230769230769 303.60757329512285 2.4.2 5.810182 108.91282051282049 349.5674621220566 3.0.0 7.810232 206.15641025641023 296.36713683400524 3.1.0 7.80769 303.4 296.4347527570483 3.2.0 3.024375 400.64358974358964 423.6685288902526 3.3.3 3.222384 497.88717948717954 418.40158895877005 3.4.0 0.943925 595.1307692307691 479.0074537898933 4.0.1a1 15.060866 11.669230769230769 103.50391474225512 2.4.2 16.613027 108.91282051282049 62.21721186011371 3.0.0 18.580455 206.15641025641023 9.884615384615415 3.1.0 18.531863 303.4 11.17713817474413 3.2.0 8.902653 400.64358974358964 267.3092870045018 3.3.3 10.138406 497.88717948717954 234.43887797688484 3.4.0 7.006885 595.1307692307691 317.73576347792925 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Cisco IOS-XE Performance (Cisco C1111-4P) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 2.4.2 3.0.0 3.1.0 3.3.3 3.4.0 3.2.0 4.0.0 4.0.1a1 Netmiko: Cisco IOS-XE Performance (Cisco C1111-4P) 4.824338 11.669230769230769 375.7904172898143 2.4.2 5.340213 95.0208791208791 362.06840143622384 3.0.0 7.53684 178.37252747252745 303.63922669733415 3.1.0 3.070582 261.7241758241758 422.43944590203483 3.3.3 3.067946 345.0758241758241 422.50956217785756 3.4.0 7.527892 428.4274725274725 303.8772390023653 3.2.0 3.077292 511.77912087912074 422.2609632727591 4.0.0 0.878103 595.1307692307691 480.758285924645 4.0.1a1 5.343782 11.669230769230769 361.9734678290875 2.4.2 5.961108 95.0208791208791 345.5529063387389 3.0.0 7.961087 178.37252747252745 292.3544696150213 3.1.0 3.149141 261.7241758241758 420.3498159656312 3.3.3 2.977177 345.0758241758241 424.92397198064805 3.4.0 7.963046 428.4274725274725 292.30236119911194 3.2.0 2.965434 511.77912087912074 425.23632988162933 4.0.0 0.778386 595.1307692307691 483.41070803246663 4.0.1a1 7.53803 11.669230769230769 303.60757329512285 2.4.2 5.810182 95.0208791208791 349.5674621220566 3.0.0 7.810232 178.37252747252745 296.36713683400524 3.1.0 3.024375 261.7241758241758 423.6685288902526 3.3.3 3.222384 345.0758241758241 418.40158895877005 3.4.0 7.80769 428.4274725274725 296.4347527570483 3.2.0 3.015565 511.77912087912074 423.9028704646071 4.0.0 1.018125 595.1307692307691 477.0337710637748 4.0.1a1 15.060866 11.669230769230769 103.50391474225512 2.4.2 16.613027 95.0208791208791 62.21721186011371 3.0.0 18.580455 178.37252747252745 9.884615384615415 3.1.0 8.902653 261.7241758241758 267.3092870045018 3.3.3 10.138406 345.0758241758241 234.43887797688484 3.4.0 18.531863 428.4274725274725 11.17713817474413 3.2.0 10.685372 511.77912087912074 219.88985714165364 4.0.0 8.635855 595.1307692307691 274.4059797802832 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_cisco_xr.svg b/tests/performance/graphs/netmiko_cisco_xr.svg
index 08a999202..7d9b07869 100644
--- a/tests/performance/graphs/netmiko_cisco_xr.svg
+++ b/tests/performance/graphs/netmiko_cisco_xr.svg
@@ -1,4 +1,4 @@
-Netmiko: Cisco IOS-XR Performance (cisco IOS-XRv 9000) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.1a1 Netmiko: Cisco IOS-XR Performance (cisco IOS-XRv 9000) 5.733791 11.669230769230769 363.8521727326825 2.4.2 6.266681 108.91282051282049 350.8163186214718 3.0.0 6.264205 206.15641025641023 350.8768879224145 3.1.0 6.273295 303.4 350.654523243267 3.2.0 8.140628 400.64358974358964 304.9747758938149 3.3.3 8.07315 497.88717948717954 306.6254605824304 3.4.0 2.203243 595.1307692307691 450.2184184130797 4.0.1a1 6.0824 11.669230769230769 355.3243038181691 2.4.2 6.900057 108.91282051282049 335.32231960940135 3.0.0 6.999404 206.15641025641023 332.8920375654777 3.1.0 6.88443 303.4 335.70459604955954 3.2.0 8.500045 400.64358974358964 296.18251562042076 3.3.3 8.433702 497.88717948717954 297.805435302344 3.4.0 2.434539 595.1307692307691 444.5603259127389 4.0.1a1 13.662819 11.669230769230769 169.88784191073972 2.4.2 11.732624 108.91282051282049 217.10535476740517 3.0.0 12.024759 206.15641025641023 209.9589845206778 3.1.0 11.881486 303.4 213.46380901743225 3.2.0 9.143244 400.64358974358964 280.4482208720175 3.3.3 9.295759 497.88717948717954 276.71731338684924 3.4.0 3.168557 595.1307692307691 426.60436584029867 4.0.1a1 18.556989 11.669230769230769 50.16390992578181 2.4.2 19.812287 108.91282051282049 19.456106074903346 3.0.0 19.590199 206.15641025641023 24.88894731390309 3.1.0 20.203558 303.4 9.884615384615358 3.2.0 16.494184 400.64358974358964 100.6254029916604 3.3.3 17.251342 497.88717948717954 82.10337925855214 3.4.0 12.212727 595.1307692307691 205.36080586171244 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Cisco IOS-XR Performance (cisco IOS-XRv 9000) 0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 2.4.2 3.0.0 3.1.0 3.3.3 3.4.0 3.2.0 4.0.0 4.0.1a1 Netmiko: Cisco IOS-XR Performance (cisco IOS-XRv 9000) 5.733791 11.669230769230769 363.8521727326825 2.4.2 6.266681 95.0208791208791 350.8163186214718 3.0.0 6.264205 178.37252747252745 350.8768879224145 3.1.0 8.140628 261.7241758241758 304.9747758938149 3.3.3 8.07315 345.0758241758241 306.6254605824304 3.4.0 6.273295 428.4274725274725 350.654523243267 3.2.0 2.767007 511.77912087912074 436.4273071947183 4.0.0 2.079637 595.1307692307691 453.2421377233882 4.0.1a1 6.0824 11.669230769230769 355.3243038181691 2.4.2 6.900057 95.0208791208791 335.32231960940135 3.0.0 6.999404 178.37252747252745 332.8920375654777 3.1.0 8.500045 261.7241758241758 296.18251562042076 3.3.3 8.433702 345.0758241758241 297.805435302344 3.4.0 6.88443 428.4274725274725 335.70459604955954 3.2.0 2.512359 511.77912087912074 442.65664941865117 4.0.0 2.49603 595.1307692307691 443.0560985766049 4.0.1a1 13.662819 11.669230769230769 169.88784191073972 2.4.2 11.732624 95.0208791208791 217.10535476740517 3.0.0 12.024759 178.37252747252745 209.9589845206778 3.1.0 9.143244 261.7241758241758 280.4482208720175 3.3.3 9.295759 345.0758241758241 276.71731338684924 3.4.0 11.881486 428.4274725274725 213.46380901743225 3.2.0 3.235152 511.77912087912074 424.97528159301294 4.0.0 3.151455 595.1307692307691 427.02272455787624 4.0.1a1 18.556989 11.669230769230769 50.16390992578181 2.4.2 19.812287 95.0208791208791 19.456106074903346 3.0.0 19.590199 178.37252747252745 24.88894731390309 3.1.0 16.494184 261.7241758241758 100.6254029916604 3.3.3 17.251342 345.0758241758241 82.10337925855214 3.4.0 20.203558 428.4274725274725 9.884615384615358 3.2.0 11.773506 511.77912087912074 216.10527635014358 4.0.0 11.866821 595.1307692307691 213.82255247394465 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_hp_procurve.svg b/tests/performance/graphs/netmiko_hp_procurve.svg
index 582fd551d..9c2e2a6a9 100644
--- a/tests/performance/graphs/netmiko_hp_procurve.svg
+++ b/tests/performance/graphs/netmiko_hp_procurve.svg
@@ -1,4 +1,4 @@
-Netmiko: HPE ProCurve Performance 0 0 10 10 20 20 30 30 40 40 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.1a1 Netmiko: HPE ProCurve Performance 11.258269 11.669230769230769 373.59571295030594 2.4.2 17.901763 108.91282051282049 296.57617685741997 3.0.0 18.419321 206.15641025641023 290.57600931588803 3.1.0 18.353988 303.4 291.3334296359119 3.2.0 18.020695 400.64358974358964 295.19737114666003 3.3.3 18.010017 497.88717948717954 295.32116362790555 3.4.0 1.97346 595.1307692307691 481.2366142427664 4.0.1a1 21.831155 11.669230769230769 251.0218422005214 2.4.2 22.221532 108.91282051282049 246.49611290185226 3.0.0 22.93706 206.15641025641023 238.20083414921538 3.1.0 22.718488 303.4 240.73478902941758 3.2.0 22.391657 400.64358974358964 244.52381510527078 3.3.3 22.410676 497.88717948717954 244.3033235150096 3.4.0 2.218327 595.1307692307691 478.39781545037545 4.0.1a1 32.216741 11.669230769230769 130.61938292641474 2.4.2 30.53423 108.91282051282049 150.12511540561582 3.0.0 31.002139 206.15641025641023 144.70054000693466 3.1.0 30.893432 303.4 145.96080496842166 3.2.0 30.752905 400.64358974358964 147.58996642300042 3.3.3 30.529921 497.88717948717954 150.17507062210643 3.4.0 2.201625 595.1307692307691 478.59144553295295 4.0.1a1 42.488945 11.669230769230769 11.531386951482148 2.4.2 42.045111 108.91282051282049 16.67685540260902 3.0.0 42.630991 206.15641025641023 9.884615384615415 3.1.0 42.584148 303.4 10.427676931626536 3.2.0 42.227986 400.64358974358964 14.556743957789934 3.3.3 42.211889 497.88717948717954 14.743360137843297 3.4.0 10.596277 595.1307692307691 381.2703366855275 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: HPE ProCurve Performance 0 0 10 10 20 20 30 30 40 40 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.1a1 Netmiko: HPE ProCurve Performance 11.258269 11.669230769230769 373.59571295030594 2.4.2 17.901763 108.91282051282049 296.57617685741997 3.0.0 18.419321 206.15641025641023 290.57600931588803 3.1.0 18.353988 303.4 291.3334296359119 3.2.0 18.020695 400.64358974358964 295.19737114666003 3.3.3 18.010017 497.88717948717954 295.32116362790555 3.4.0 2.028994 595.1307692307691 480.59279595718016 4.0.1a1 21.831155 11.669230769230769 251.0218422005214 2.4.2 22.221532 108.91282051282049 246.49611290185226 3.0.0 22.93706 206.15641025641023 238.20083414921538 3.1.0 22.718488 303.4 240.73478902941758 3.2.0 22.391657 400.64358974358964 244.52381510527078 3.3.3 22.410676 497.88717948717954 244.3033235150096 3.4.0 2.139018 595.1307692307691 479.3172627153223 4.0.1a1 32.216741 11.669230769230769 130.61938292641474 2.4.2 30.53423 108.91282051282049 150.12511540561582 3.0.0 31.002139 206.15641025641023 144.70054000693466 3.1.0 30.893432 303.4 145.96080496842166 3.2.0 30.752905 400.64358974358964 147.58996642300042 3.3.3 30.529921 497.88717948717954 150.17507062210643 3.4.0 2.222841 595.1307692307691 478.34548362228566 4.0.1a1 42.488945 11.669230769230769 11.531386951482148 2.4.2 42.045111 108.91282051282049 16.67685540260902 3.0.0 42.630991 206.15641025641023 9.884615384615415 3.1.0 42.584148 303.4 10.427676931626536 3.2.0 42.227986 400.64358974358964 14.556743957789934 3.3.3 42.211889 497.88717948717954 14.743360137843297 3.4.0 10.582982 595.1307692307691 381.4244686426505 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/graphs/netmiko_juniper_junos.svg b/tests/performance/graphs/netmiko_juniper_junos.svg
index 54805f1e3..5b8b3ffea 100644
--- a/tests/performance/graphs/netmiko_juniper_junos.svg
+++ b/tests/performance/graphs/netmiko_juniper_junos.svg
@@ -1,4 +1,4 @@
-Netmiko: Juniper Junos Performance 0 0 4 4 8 8 12 12 16 16 20 20 24 24 28 28 32 32 36 36 2.4.2 3.0.0 3.1.0 3.2.0 3.3.3 3.4.0 4.0.1a1 Netmiko: Juniper Junos Performance 6.955827 11.669230769230769 413.13380793339843 2.4.2 8.245966 108.91282051282049 396.2589086067014 3.0.0 7.763991 206.15641025641023 402.5630972274506 3.1.0 7.762834 303.4 402.5782306809165 3.2.0 3.517362 400.64358974358964 458.10861352672697 3.3.3 3.991287 497.88717948717954 451.90971816475053 3.4.0 3.311785 595.1307692307691 460.7975417576264 4.0.1a1 7.795193 11.669230769230769 402.1549779404656 2.4.2 8.638104 108.91282051282049 391.1297796739489 3.0.0 8.640627 206.15641025641023 391.0967790662615 3.1.0 8.832251 303.4 388.590354790599 3.2.0 4.262974 400.64358974358964 448.3560772211217 3.3.3 4.1622 497.88717948717954 449.6741918620624 3.4.0 4.06215 595.1307692307691 450.9828366496675 4.0.1a1 20.183726 11.669230769230769 240.1141070106945 2.4.2 18.754187 108.91282051282049 258.8123455017309 3.0.0 18.747711 206.15641025641023 258.89705098543436 3.1.0 18.852219 303.4 257.53009596831254 3.2.0 14.697604 400.64358974358964 311.87207762004573 3.3.3 16.79162 497.88717948717954 284.48254115266286 3.4.0 3.734963 595.1307692307691 455.2624124829723 4.0.1a1 35.183576 11.669230769230769 43.91745016553557 2.4.2 37.204469 108.91282051282049 17.484355805139785 3.0.0 37.257378 206.15641025641023 16.792310956889935 3.1.0 37.785493 303.4 9.884615384615415 3.2.0 29.58927 400.64358974358964 117.09045753353024 3.3.3 27.660851 497.88717948717954 142.3140004887387 3.4.0 17.751708 595.1307692307691 271.92467851555955 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
+Netmiko: Juniper Junos Performance 0 0 4 4 8 8 12 12 16 16 20 20 24 24 28 28 32 32 36 36 2.4.2 3.0.0 3.1.0 3.3.3 3.4.0 3.2.0 4.0.0 4.0.1a1 Netmiko: Juniper Junos Performance 6.955827 11.669230769230769 413.13380793339843 2.4.2 8.245966 95.0208791208791 396.2589086067014 3.0.0 7.763991 178.37252747252745 402.5630972274506 3.1.0 3.517362 261.7241758241758 458.10861352672697 3.3.3 3.991287 345.0758241758241 451.90971816475053 3.4.0 7.762834 428.4274725274725 402.5782306809165 3.2.0 5.92602 511.77912087912074 426.60358867092197 4.0.0 3.435827 595.1307692307691 459.17508381915457 4.0.1a1 7.795193 11.669230769230769 402.1549779404656 2.4.2 8.638104 95.0208791208791 391.1297796739489 3.0.0 8.640627 178.37252747252745 391.0967790662615 3.1.0 4.262974 261.7241758241758 448.3560772211217 3.3.3 4.1622 345.0758241758241 449.6741918620624 3.4.0 8.832251 428.4274725274725 388.590354790599 3.2.0 6.641656 511.77912087912074 417.24313568518926 4.0.0 3.882981 595.1307692307691 453.3263506721604 4.0.1a1 20.183726 11.669230769230769 240.1141070106945 2.4.2 18.754187 95.0208791208791 258.8123455017309 3.0.0 18.747711 178.37252747252745 258.89705098543436 3.1.0 14.697604 261.7241758241758 311.87207762004573 3.3.3 16.79162 345.0758241758241 284.48254115266286 3.4.0 18.852219 428.4274725274725 257.53009596831254 3.2.0 17.185611 511.77912087912074 279.3291751505308 4.0.0 3.512782 595.1307692307691 458.1685195050101 4.0.1a1 35.183576 11.669230769230769 43.91745016553557 2.4.2 37.204469 95.0208791208791 17.484355805139785 3.0.0 37.257378 178.37252747252745 16.792310956889935 3.1.0 29.58927 261.7241758241758 117.09045753353024 3.3.3 27.660851 345.0758241758241 142.3140004887387 3.4.0 37.785493 428.4274725274725 9.884615384615415 3.2.0 32.165569 511.77912087912074 83.39270383375816 4.0.0 19.214745 595.1307692307691 252.78828926894903 4.0.1a1 Connect Show Command Simple Config Large ACL
\ No newline at end of file
diff --git a/tests/performance/netmiko_performance.csv b/tests/performance/netmiko_performance.csv
index 9b41cd997..192b1793e 100644
--- a/tests/performance/netmiko_performance.csv
+++ b/tests/performance/netmiko_performance.csv
@@ -60,11 +60,11 @@ date,netmiko_version,device_name,connect,send_command_simple,send_config_simple,
2022-3-23 14:33:38,4.0.0,arista1,0:00:01.687836,0:00:02.167681,0:00:03.117634,0:00:21.231472
2022-3-23 14:34:57,4.0.0,juniper_vmx,0:00:05.926020,0:00:06.641656,0:00:17.185611,0:00:32.165569
2022-3-23 14:35:27,4.0.0,cisco_asa,0:00:05.193105,0:00:04.572510,0:00:05.568892,0:00:09.710037
-2022-4-26 13:45:1,4.0.1a1,cisco1,0:00:00.857724,0:00:00.931702,0:00:00.925704,0:00:04.221053
-2022-4-26 13:45:12,4.0.1a1,cisco3,0:00:00.763497,0:00:01.044846,0:00:00.943925,0:00:07.006885
-2022-4-26 13:45:28,4.0.1a1,cisco5,0:00:01.400548,0:00:01.111659,0:00:01.537387,0:00:10.841677
-2022-4-26 13:46:4,4.0.1a1,nxos1,0:00:03.026680,0:00:03.264042,0:00:04.075294,0:00:20.931428
-2022-4-26 13:46:27,4.0.1a1,cisco_xr_azure,0:00:02.203243,0:00:02.434539,0:00:03.168557,0:00:12.212727
-2022-4-26 13:46:57,4.0.1a1,arista1,0:00:01.705048,0:00:02.553805,0:00:02.970468,0:00:20.467766
-2022-4-26 13:47:30,4.0.1a1,juniper_vmx,0:00:03.311785,0:00:04.062150,0:00:03.734963,0:00:17.751708
-2022-4-26 13:50:17,4.0.1a1,hp_procurve,0:00:01.973460,0:00:02.218327,0:00:02.201625,0:00:10.596277
+2022-4-26 14:2:11,4.0.1a1,cisco1,0:00:01.063310,0:00:01.119291,0:00:01.125631,0:00:04.039539
+2022-4-26 14:2:24,4.0.1a1,cisco3,0:00:00.878103,0:00:00.778386,0:00:01.018125,0:00:08.635855
+2022-4-26 14:2:42,4.0.1a1,cisco5,0:00:01.356996,0:00:01.121357,0:00:01.593118,0:00:13.054712
+2022-4-26 14:3:17,4.0.1a1,nxos1,0:00:03.239731,0:00:03.440601,0:00:04.322041,0:00:20.021282
+2022-4-26 14:3:40,4.0.1a1,cisco_xr_azure,0:00:02.079637,0:00:02.496030,0:00:03.151455,0:00:11.866821
+2022-4-26 14:4:12,4.0.1a1,arista1,0:00:01.841382,0:00:01.905576,0:00:03.065721,0:00:23.224994
+2022-4-26 14:4:46,4.0.1a1,juniper_vmx,0:00:03.435827,0:00:03.882981,0:00:03.512782,0:00:19.214745
+2022-4-26 14:7:33,4.0.1a1,hp_procurve,0:00:02.028994,0:00:02.139018,0:00:02.222841,0:00:10.582982
diff --git a/tests/performance/test_netmiko.py b/tests/performance/test_netmiko.py
index 0a3e0a6c4..3c6bf118d 100644
--- a/tests/performance/test_netmiko.py
+++ b/tests/performance/test_netmiko.py
@@ -76,7 +76,7 @@ def wrapper_decorator(*args, **kwargs):
def read_devices():
f_name = os.environ.get("TEST_DEVICES", "test_devices.yml")
with open(f_name) as f:
- return yaml.load(f)
+ return yaml.safe_load(f)
@f_exec_time
From 765f4326121c4533ef7939c1ae445fa3995d6f56 Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Tue, 26 Apr 2022 21:07:10 -0700
Subject: [PATCH 26/29] Improve Juniper config_mode pattern (#2762)
Fix some minor test issues
---
netmiko/juniper/juniper.py | 8 ++++++--
tests/SLOG/netmiko.log | 11 +++++++----
tests/run_live_tests.sh | 6 +++---
tests/test_timeout_send_command_timing.py | 2 +-
4 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/netmiko/juniper/juniper.py b/netmiko/juniper/juniper.py
index fbe8d8b99..e793e3531 100644
--- a/netmiko/juniper/juniper.py
+++ b/netmiko/juniper/juniper.py
@@ -84,10 +84,14 @@ def check_config_mode(
def config_mode(
self,
config_command: str = "configure",
- pattern: str = r"Entering configuration mode",
+ pattern: str = r"(?s)Entering configuration mode.*\].*#",
re_flags: int = 0,
) -> str:
- """Enter configuration mode."""
+ """
+ Enter configuration mode.
+
+ (?s) enables re.DOTALL in regex pattern.
+ """
return super().config_mode(
config_command=config_command, pattern=pattern, re_flags=re_flags
)
diff --git a/tests/SLOG/netmiko.log b/tests/SLOG/netmiko.log
index bf64a8446..a74094652 100644
--- a/tests/SLOG/netmiko.log
+++ b/tests/SLOG/netmiko.log
@@ -16,6 +16,7 @@ write_channel: b'********\n'
read_channel:
read_channel:
read_channel:
+read_channel:
cisco1#
Pattern found: (cisco1) :
cisco1
@@ -28,9 +29,10 @@ cisco1#
read_channel:
write_channel: b'\n'
read_channel:
-cisco1#
-read_channel:
read_channel:
+cisco1#
+Pattern found: ([>#])
+cisco1#
write_channel: b'exit\n'
write_channel: b'terminal width 511\n'
read_channel:
@@ -117,7 +119,8 @@ Pattern found: (show\ ip\ interface\ brief) show ip interface brief
read_channel:
write_channel: b'\n'
read_channel:
-cisco1>
-read_channel:
read_channel:
+cisco1>
+Pattern found: ([>#])
+cisco1>
write_channel: b'exit\n'
diff --git a/tests/run_live_tests.sh b/tests/run_live_tests.sh
index a83b5ad7c..8e889fff9 100755
--- a/tests/run_live_tests.sh
+++ b/tests/run_live_tests.sh
@@ -22,6 +22,6 @@ cd ..
cd test_juniper_junos
./test_juniper_junos.sh > ../test_out/test_juniper_junos.out 2> ../test_out/test_juniper_junos.stderr &
-cd ..
-cd test_cisco_asa
-./test_cisco_asa.sh > ../test_out/test_cisco_asa.out 2> ../test_out/test_cisco_asa.stderr &
+# cd ..
+# cd test_cisco_asa
+# ./test_cisco_asa.sh > ../test_out/test_cisco_asa.out 2> ../test_out/test_cisco_asa.stderr &
diff --git a/tests/test_timeout_send_command_timing.py b/tests/test_timeout_send_command_timing.py
index 134a0ee09..513679b3e 100644
--- a/tests/test_timeout_send_command_timing.py
+++ b/tests/test_timeout_send_command_timing.py
@@ -18,7 +18,7 @@ def test_read_show_tech(net_connect_newconn):
read_timeout = 0
output, exec_time = execute_cmd(
- net_connect_newconn, read_timeout=read_timeout, last_read=4.0
+ net_connect_newconn, read_timeout=read_timeout, last_read=8.0
)
assert "show interface" in output
assert "cisco3#" in output
From 4ed0c50159b851897aa9aac1160369710c51b089 Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Wed, 27 Apr 2022 11:24:04 -0700
Subject: [PATCH 27/29] Fix deprecated regex format (#2763)
---
netmiko/juniper/juniper.py | 8 ++++----
tests/test_juniper_junos/add_delay_juniper_junos.sh | 9 +++++++++
tests/test_netmiko_show.py | 2 +-
3 files changed, 14 insertions(+), 5 deletions(-)
create mode 100755 tests/test_juniper_junos/add_delay_juniper_junos.sh
diff --git a/netmiko/juniper/juniper.py b/netmiko/juniper/juniper.py
index e793e3531..45ee1b573 100644
--- a/netmiko/juniper/juniper.py
+++ b/netmiko/juniper/juniper.py
@@ -68,12 +68,12 @@ def enter_cli_mode(self) -> None:
return
def check_config_mode(
- self, check_string: str = "]", pattern: str = r"(?m)[>#] $"
+ self, check_string: str = "]", pattern: str = r"(?m:[>#] $)"
) -> bool:
"""
Checks if the device is in configuration mode or not.
- (?m) = Use multiline matching
+ ?m = Use multiline matching
Juniper unfortunately will use # as a message indicator when not in config mode
For example, with commit confirmed.
@@ -84,13 +84,13 @@ def check_config_mode(
def config_mode(
self,
config_command: str = "configure",
- pattern: str = r"(?s)Entering configuration mode.*\].*#",
+ pattern: str = r"(?s:Entering configuration mode.*\].*#)",
re_flags: int = 0,
) -> str:
"""
Enter configuration mode.
- (?s) enables re.DOTALL in regex pattern.
+ ?s = enables re.DOTALL in regex pattern.
"""
return super().config_mode(
config_command=config_command, pattern=pattern, re_flags=re_flags
diff --git a/tests/test_juniper_junos/add_delay_juniper_junos.sh b/tests/test_juniper_junos/add_delay_juniper_junos.sh
new file mode 100755
index 000000000..9650a6882
--- /dev/null
+++ b/tests/test_juniper_junos/add_delay_juniper_junos.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# Add delay for cisco3; must be root or sudo to execute
+sudo -s /sbin/tc qdisc del dev eth0 root
+sudo -s /sbin/tc qdisc add dev eth0 root handle 1: prio
+sudo -s /sbin/tc qdisc add dev eth0 parent 1:3 handle 30: tbf rate 20kbit buffer 1600 limit 3000
+sudo -s /sbin/tc qdisc add dev eth0 parent 30:1 handle 31: netem delay 1000ms 10ms distribution normal loss 10%
+sudo -s /sbin/tc filter add dev eth0 protocol ip parent 1:0 prio 3 u32 match ip dst 52.53.154.237 flowid 1:3
+
diff --git a/tests/test_netmiko_show.py b/tests/test_netmiko_show.py
index f85acba27..87cc74f74 100755
--- a/tests/test_netmiko_show.py
+++ b/tests/test_netmiko_show.py
@@ -332,7 +332,7 @@ def test_clear_buffer(net_connect, commands, expected_responses):
enter = net_connect.RETURN
# Manually send a command down the channel so that data needs read.
net_connect.write_channel(f"{commands['basic']}{enter}")
- time.sleep(1)
+ time.sleep(4)
net_connect.clear_buffer()
time.sleep(2)
From ae4d89787646b76d2a359fc0db6ee3a9bb3222a0 Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Wed, 27 Apr 2022 11:29:36 -0700
Subject: [PATCH 28/29] Update docs: Netmiko 4.1.0 (#2764)
---
docs/netmiko/aruba/aruba_ssh.html | 6 +-
docs/netmiko/aruba/index.html | 4 +-
docs/netmiko/base_connection.html | 18 +-
docs/netmiko/cisco/cisco_ios.html | 88 ++++++-
docs/netmiko/cisco/cisco_nxos_ssh.html | 14 +-
docs/netmiko/cisco/cisco_wlc_ssh.html | 180 ++++++++------
docs/netmiko/cisco/cisco_xr.html | 78 +++++-
docs/netmiko/cisco/index.html | 197 +++++++++------
docs/netmiko/cisco_base_connection.html | 11 +-
docs/netmiko/dell/dell_isilon_ssh.html | 2 +-
docs/netmiko/dell/index.html | 2 +-
docs/netmiko/extreme/extreme_exos.html | 4 +-
docs/netmiko/hp/hp_comware.html | 2 +-
docs/netmiko/hp/hp_procurve.html | 83 +++++--
docs/netmiko/huawei/huawei.html | 68 ++---
docs/netmiko/huawei/index.html | 45 +---
docs/netmiko/index.html | 14 +-
docs/netmiko/juniper/juniper.html | 233 ++++++++++++------
docs/netmiko/keymile/index.html | 2 +-
docs/netmiko/keymile/keymile_nos_ssh.html | 2 +-
docs/netmiko/linux/index.html | 4 +-
docs/netmiko/linux/linux_ssh.html | 4 +-
docs/netmiko/mellanox/index.html | 2 +-
.../netmiko/mellanox/mellanox_mlnxos_ssh.html | 2 +-
docs/netmiko/mrv/index.html | 2 +-
docs/netmiko/mrv/mrv_ssh.html | 2 +-
docs/netmiko/no_enable.html | 2 +-
docs/netmiko/nokia/nokia_sros.html | 37 ++-
docs/netmiko/ruckus/ruckus_fastiron.html | 2 +-
docs/netmiko/ssh_autodetect.html | 2 +-
docs/netmiko/tplink/tplink_jetstream.html | 2 +-
docs/netmiko/ubiquiti/edge_ssh.html | 127 ++++++++--
docs/netmiko/ubiquiti/edgerouter_ssh.html | 26 +-
docs/netmiko/ubiquiti/index.html | 113 ++++++---
docs/netmiko/utilities.html | 53 +++-
docs/netmiko/vyos/index.html | 33 +--
docs/netmiko/vyos/vyos_ssh.html | 47 ++--
release_process.txt | 2 +-
38 files changed, 976 insertions(+), 539 deletions(-)
diff --git a/docs/netmiko/aruba/aruba_ssh.html b/docs/netmiko/aruba/aruba_ssh.html
index 68912a967..f6d8f5dd9 100644
--- a/docs/netmiko/aruba/aruba_ssh.html
+++ b/docs/netmiko/aruba/aruba_ssh.html
@@ -52,7 +52,7 @@ Module netmiko.aruba.aruba_ssh
self._test_channel_read(pattern=r"[>#]")
self.set_base_prompt()
self.enable()
- self.disable_paging(command="no page")
+ self.disable_paging(command="no paging")
def check_config_mode(
self, check_string: str = "(config) #", pattern: str = r"[>#]"
@@ -214,7 +214,7 @@
self._test_channel_read(pattern=r"[>#]")
self.set_base_prompt()
self.enable()
- self.disable_paging(command="no page")
+ self.disable_paging(command="no paging")
def check_config_mode(
self, check_string: str = "(config) #", pattern: str = r"[>#]"
@@ -297,7 +297,7 @@ Methods
self._test_channel_read(pattern=r"[>#]")
self.set_base_prompt()
self.enable()
- self.disable_paging(command="no page")
+ self.disable_paging(command="no paging")
diff --git a/docs/netmiko/aruba/index.html b/docs/netmiko/aruba/index.html
index 7419d6574..6e4b9a538 100644
--- a/docs/netmiko/aruba/index.html
+++ b/docs/netmiko/aruba/index.html
@@ -172,7 +172,7 @@
self._test_channel_read(pattern=r"[>#]")
self.set_base_prompt()
self.enable()
- self.disable_paging(command="no page")
+ self.disable_paging(command="no paging")
def check_config_mode(
self, check_string: str = "(config) #", pattern: str = r"[>#]"
@@ -255,7 +255,7 @@ Methods
self._test_channel_read(pattern=r"[>#]")
self.set_base_prompt()
self.enable()
- self.disable_paging(command="no page")
+ self.disable_paging(command="no paging")
diff --git a/docs/netmiko/base_connection.html b/docs/netmiko/base_connection.html
index 85508950e..cafaa1d19 100644
--- a/docs/netmiko/base_connection.html
+++ b/docs/netmiko/base_connection.html
@@ -643,7 +643,7 @@ Module netmiko.base_connection
results = re.split(pattern, output, maxsplit=1, flags=re_flags)
# The string matched by pattern must be retained in the output string.
- # re.split will do this if capturing parentesis are used.
+ # re.split will do this if capturing parenthesis are used.
if len(results) == 2:
# no capturing parenthesis, convert and try again.
pattern = f"({pattern})"
@@ -1150,7 +1150,7 @@ Module netmiko.base_connection
time.sleep(main_delay * 10)
new_data = ""
while i <= count:
- new_data += self.read_channel_timing()
+ new_data += self.read_channel_timing(read_timeout=20)
if new_data:
return new_data
@@ -1971,7 +1971,7 @@ Module netmiko.base_connection
self.write_channel(self.RETURN)
# You can encounter an issue here (on router name changes) prefer delay-based solution
if not pattern:
- output = self.read_channel_timing()
+ output = self.read_channel_timing(read_timeout=10.0)
else:
output = self.read_until_pattern(pattern=pattern)
return check_string in output
@@ -3068,7 +3068,7 @@
results = re.split(pattern, output, maxsplit=1, flags=re_flags)
# The string matched by pattern must be retained in the output string.
- # re.split will do this if capturing parentesis are used.
+ # re.split will do this if capturing parenthesis are used.
if len(results) == 2:
# no capturing parenthesis, convert and try again.
pattern = f"({pattern})"
@@ -3575,7 +3575,7 @@
time.sleep(main_delay * 10)
new_data = ""
while i <= count:
- new_data += self.read_channel_timing()
+ new_data += self.read_channel_timing(read_timeout=20)
if new_data:
return new_data
@@ -4396,7 +4396,7 @@
self.write_channel(self.RETURN)
# You can encounter an issue here (on router name changes) prefer delay-based solution
if not pattern:
- output = self.read_channel_timing()
+ output = self.read_channel_timing(read_timeout=10.0)
else:
output = self.read_until_pattern(pattern=pattern)
return check_string in output
@@ -4892,7 +4892,7 @@ Methods
self.write_channel(self.RETURN)
# You can encounter an issue here (on router name changes) prefer delay-based solution
if not pattern:
- output = self.read_channel_timing()
+ output = self.read_channel_timing(read_timeout=10.0)
else:
output = self.read_until_pattern(pattern=pattern)
return check_string in output
@@ -5120,7 +5120,7 @@ Methods
-def enable (self, cmd='', pattern='ssword', enable_pattern=None, re_flags=)
+def enable (self, cmd='', pattern='ssword', enable_pattern=None, re_flags=re.IGNORECASE)
Enter enable mode.
@@ -5711,7 +5711,7 @@ Methods
results = re.split(pattern, output, maxsplit=1, flags=re_flags)
# The string matched by pattern must be retained in the output string.
- # re.split will do this if capturing parentesis are used.
+ # re.split will do this if capturing parenthesis are used.
if len(results) == 2:
# no capturing parenthesis, convert and try again.
pattern = f"({pattern})"
diff --git a/docs/netmiko/cisco/cisco_ios.html b/docs/netmiko/cisco/cisco_ios.html
index 1e6f961ec..415a0da32 100644
--- a/docs/netmiko/cisco/cisco_ios.html
+++ b/docs/netmiko/cisco/cisco_ios.html
@@ -44,7 +44,30 @@ Module netmiko.cisco.cisco_ios
self.disable_paging()
self.set_base_prompt()
- def check_config_mode(self, check_string: str = ")#", pattern: str = r"#") -> bool:
+ def set_base_prompt(
+ self,
+ pri_prompt_terminator: str = "#",
+ alt_prompt_terminator: str = ">",
+ delay_factor: float = 1.0,
+ pattern: Optional[str] = None,
+ ) -> str:
+ """
+ Cisco IOS/IOS-XE abbreviates the prompt at 20-chars in config mode.
+
+ Consequently, abbreviate the base_prompt
+ """
+ base_prompt = super().set_base_prompt(
+ pri_prompt_terminator=pri_prompt_terminator,
+ alt_prompt_terminator=alt_prompt_terminator,
+ delay_factor=delay_factor,
+ pattern=pattern,
+ )
+ self.base_prompt = base_prompt[:16]
+ return self.base_prompt
+
+ def check_config_mode(
+ self, check_string: str = ")#", pattern: str = r"[>#]"
+ ) -> bool:
"""
Checks if the device is in configuration mode or not.
@@ -419,7 +442,30 @@
self.disable_paging()
self.set_base_prompt()
- def check_config_mode(self, check_string: str = ")#", pattern: str = r"#") -> bool:
+ def set_base_prompt(
+ self,
+ pri_prompt_terminator: str = "#",
+ alt_prompt_terminator: str = ">",
+ delay_factor: float = 1.0,
+ pattern: Optional[str] = None,
+ ) -> str:
+ """
+ Cisco IOS/IOS-XE abbreviates the prompt at 20-chars in config mode.
+
+ Consequently, abbreviate the base_prompt
+ """
+ base_prompt = super().set_base_prompt(
+ pri_prompt_terminator=pri_prompt_terminator,
+ alt_prompt_terminator=alt_prompt_terminator,
+ delay_factor=delay_factor,
+ pattern=pattern,
+ )
+ self.base_prompt = base_prompt[:16]
+ return self.base_prompt
+
+ def check_config_mode(
+ self, check_string: str = ")#", pattern: str = r"[>#]"
+ ) -> bool:
"""
Checks if the device is in configuration mode or not.
@@ -481,6 +527,36 @@ Methods
self.set_base_prompt()
+
+def set_base_prompt (self, pri_prompt_terminator='#', alt_prompt_terminator='>', delay_factor=1.0, pattern=None)
+
+
+Cisco IOS/IOS-XE abbreviates the prompt at 20-chars in config mode.
+Consequently, abbreviate the base_prompt
+
+Source code
+def set_base_prompt(
+ self,
+ pri_prompt_terminator: str = "#",
+ alt_prompt_terminator: str = ">",
+ delay_factor: float = 1.0,
+ pattern: Optional[str] = None,
+) -> str:
+ """
+ Cisco IOS/IOS-XE abbreviates the prompt at 20-chars in config mode.
+
+ Consequently, abbreviate the base_prompt
+ """
+ base_prompt = super().set_base_prompt(
+ pri_prompt_terminator=pri_prompt_terminator,
+ alt_prompt_terminator=alt_prompt_terminator,
+ delay_factor=delay_factor,
+ pattern=pattern,
+ )
+ self.base_prompt = base_prompt[:16]
+ return self.base_prompt
+
+
Inherited members
@@ -516,7 +592,6 @@ Inherited members
send_config_from_file
send_config_set
send_multiline
-set_base_prompt
set_terminal_width
special_login_handler
strip_ansi_escape_codes
@@ -734,7 +809,7 @@ Inherited members
send_config_set
send_multiline
session_preparation
-set_base_prompt
+set_base_prompt
set_terminal_width
special_login_handler
strip_ansi_escape_codes
@@ -905,7 +980,7 @@ Inherited members
send_config_set
send_multiline
session_preparation
-set_base_prompt
+set_base_prompt
set_terminal_width
special_login_handler
strip_ansi_escape_codes
@@ -1076,7 +1151,7 @@ Inherited members
send_config_set
send_multiline
session_preparation
-set_base_prompt
+set_base_prompt
set_terminal_width
special_login_handler
strip_ansi_escape_codes
@@ -1387,6 +1462,7 @@
diff --git a/docs/netmiko/cisco/cisco_nxos_ssh.html b/docs/netmiko/cisco/cisco_nxos_ssh.html
index 72011f5e0..e2e6992c9 100644
--- a/docs/netmiko/cisco/cisco_nxos_ssh.html
+++ b/docs/netmiko/cisco/cisco_nxos_ssh.html
@@ -48,7 +48,9 @@ Module netmiko.cisco.cisco_nxos_ssh
# NX-OS fix for incorrect MD5 on 9K (due to strange <enter> patterns on NX-OS)
return newline.sub(self.RESPONSE_RETURN, a_string).replace("\r", "\n")
- def check_config_mode(self, check_string: str = ")#", pattern: str = "#") -> bool:
+ def check_config_mode(
+ self, check_string: str = ")#", pattern: str = r"[>#]"
+ ) -> bool:
"""Checks if the device is in configuration mode or not."""
return super().check_config_mode(check_string=check_string, pattern=pattern)
@@ -501,7 +503,9 @@ Inherited members
# NX-OS fix for incorrect MD5 on 9K (due to strange <enter> patterns on NX-OS)
return newline.sub(self.RESPONSE_RETURN, a_string).replace("\r", "\n")
- def check_config_mode(self, check_string: str = ")#", pattern: str = "#") -> bool:
+ def check_config_mode(
+ self, check_string: str = ")#", pattern: str = r"[>#]"
+ ) -> bool:
"""Checks if the device is in configuration mode or not."""
return super().check_config_mode(check_string=check_string, pattern=pattern)
@@ -546,13 +550,15 @@ Ancestors
Methods
-def check_config_mode (self, check_string=')#', pattern='#')
+def check_config_mode (self, check_string=')#', pattern='[>#]')
Checks if the device is in configuration mode or not.
Source code
-def check_config_mode(self, check_string: str = ")#", pattern: str = "#") -> bool:
+def check_config_mode(
+ self, check_string: str = ")#", pattern: str = r"[>#]"
+) -> bool:
"""Checks if the device is in configuration mode or not."""
return super().check_config_mode(check_string=check_string, pattern=pattern)
diff --git a/docs/netmiko/cisco/cisco_wlc_ssh.html b/docs/netmiko/cisco/cisco_wlc_ssh.html
index 8016ec807..6aeb6e6c0 100644
--- a/docs/netmiko/cisco/cisco_wlc_ssh.html
+++ b/docs/netmiko/cisco/cisco_wlc_ssh.html
@@ -76,10 +76,12 @@ Module netmiko.cisco.cisco_wlc_ssh
def send_command_w_enter(self, *args: Any, **kwargs: Any) -> str:
"""
For 'show run-config' Cisco WLC adds a 'Press Enter to continue...' message
- Even though pagination is disabled
+ Even though pagination is disabled.
+
show run-config also has excessive delays in the output which requires special
handling.
- Arguments are the same as send_command_timing() method
+
+ Arguments are the same as send_command_timing() method.
"""
if len(args) > 1:
raise ValueError("Must pass in delay_factor as keyword argument")
@@ -89,17 +91,18 @@ Module netmiko.cisco.cisco_wlc_ssh
kwargs["delay_factor"] = self.select_delay_factor(delay_factor)
output = self._send_command_timing_str(*args, **kwargs)
+ second_args = list(args)
+ if len(args) == 1:
+ second_args[0] = self.RETURN
+ else:
+ kwargs["command_string"] = self.RETURN
+ if not kwargs.get("max_loops"):
+ kwargs["max_loops"] = 150
+
if "Press any key" in output or "Press Enter to" in output:
- new_args = list(args)
- if len(args) == 1:
- new_args[0] = self.RETURN
- else:
- kwargs["command_string"] = self.RETURN
- if not kwargs.get("max_loops"):
- kwargs["max_loops"] = 150
# Send an 'enter'
- output += self._send_command_timing_str(*new_args, **kwargs)
+ output += self._send_command_timing_str(*second_args, **kwargs)
# WLC has excessive delay after this appears on screen
if "802.11b Advanced Configuration" in output:
@@ -125,17 +128,42 @@ Module netmiko.cisco.cisco_wlc_ssh
output = self.strip_prompt(output)
return output
- def send_command_w_yes(self, *args: Any, **kwargs: Any) -> str:
+ def _send_command_w_yes(self, *args: Any, **kwargs: Any) -> str:
"""
For 'show interface summary' Cisco WLC adds a
- 'Would you like to display the next 15 entries?' message
+ 'Would you like to display the next 15 entries?' message.
+
Even though pagination is disabled
- Arguments are the same as send_command_timing() method
+ Arguments are the same as send_command_timing() method.
"""
- output = self._send_command_timing_str(*args, **kwargs)
- if "(y/n)" in output:
- output += self._send_command_timing_str("y")
+ if len(args) > 1:
+ raise ValueError("Must pass in delay_factor as keyword argument")
+
+ # If no delay_factor use 1 for default value
+ delay_factor = kwargs.get("delay_factor", 1)
+ kwargs["delay_factor"] = self.select_delay_factor(delay_factor)
+
+ output = ""
+ new_output = self._send_command_timing_str(*args, **kwargs)
+
+ second_args = list(args)
+ if len(args) == 1:
+ second_args[0] = "y"
+ else:
+ kwargs["command_string"] = "y"
strip_prompt = kwargs.get("strip_prompt", True)
+
+ while True:
+ output += new_output
+ if "display the next" in new_output.lower():
+ new_output = self._send_command_timing_str(*second_args, **kwargs)
+ else:
+ break
+
+ # Remove from output 'Would you like to display the next 15 entries? (y/n)'
+ pattern = r"^.*display the next.*\n$"
+ output = re.sub(pattern, "", output, flags=re.M)
+
if strip_prompt:
# Had to strip trailing prompt twice.
output = self.strip_prompt(output)
@@ -412,10 +440,12 @@
def send_command_w_enter(self, *args: Any, **kwargs: Any) -> str:
"""
For 'show run-config' Cisco WLC adds a 'Press Enter to continue...' message
- Even though pagination is disabled
+ Even though pagination is disabled.
+
show run-config also has excessive delays in the output which requires special
handling.
- Arguments are the same as send_command_timing() method
+
+ Arguments are the same as send_command_timing() method.
"""
if len(args) > 1:
raise ValueError("Must pass in delay_factor as keyword argument")
@@ -425,17 +455,18 @@
kwargs["delay_factor"] = self.select_delay_factor(delay_factor)
output = self._send_command_timing_str(*args, **kwargs)
+ second_args = list(args)
+ if len(args) == 1:
+ second_args[0] = self.RETURN
+ else:
+ kwargs["command_string"] = self.RETURN
+ if not kwargs.get("max_loops"):
+ kwargs["max_loops"] = 150
+
if "Press any key" in output or "Press Enter to" in output:
- new_args = list(args)
- if len(args) == 1:
- new_args[0] = self.RETURN
- else:
- kwargs["command_string"] = self.RETURN
- if not kwargs.get("max_loops"):
- kwargs["max_loops"] = 150
# Send an 'enter'
- output += self._send_command_timing_str(*new_args, **kwargs)
+ output += self._send_command_timing_str(*second_args, **kwargs)
# WLC has excessive delay after this appears on screen
if "802.11b Advanced Configuration" in output:
@@ -461,17 +492,42 @@
output = self.strip_prompt(output)
return output
- def send_command_w_yes(self, *args: Any, **kwargs: Any) -> str:
+ def _send_command_w_yes(self, *args: Any, **kwargs: Any) -> str:
"""
For 'show interface summary' Cisco WLC adds a
- 'Would you like to display the next 15 entries?' message
+ 'Would you like to display the next 15 entries?' message.
+
Even though pagination is disabled
- Arguments are the same as send_command_timing() method
+ Arguments are the same as send_command_timing() method.
"""
- output = self._send_command_timing_str(*args, **kwargs)
- if "(y/n)" in output:
- output += self._send_command_timing_str("y")
+ if len(args) > 1:
+ raise ValueError("Must pass in delay_factor as keyword argument")
+
+ # If no delay_factor use 1 for default value
+ delay_factor = kwargs.get("delay_factor", 1)
+ kwargs["delay_factor"] = self.select_delay_factor(delay_factor)
+
+ output = ""
+ new_output = self._send_command_timing_str(*args, **kwargs)
+
+ second_args = list(args)
+ if len(args) == 1:
+ second_args[0] = "y"
+ else:
+ kwargs["command_string"] = "y"
strip_prompt = kwargs.get("strip_prompt", True)
+
+ while True:
+ output += new_output
+ if "display the next" in new_output.lower():
+ new_output = self._send_command_timing_str(*second_args, **kwargs)
+ else:
+ break
+
+ # Remove from output 'Would you like to display the next 15 entries? (y/n)'
+ pattern = r"^.*display the next.*\n$"
+ output = re.sub(pattern, "", output, flags=re.M)
+
if strip_prompt:
# Had to strip trailing prompt twice.
output = self.strip_prompt(output)
@@ -711,19 +767,21 @@ Methods
For 'show run-config' Cisco WLC adds a 'Press Enter to continue…' message
-Even though pagination is disabled
-show run-config also has excessive delays in the output which requires special
-handling.
-Arguments are the same as send_command_timing() method
+Even though pagination is disabled.
+show run-config also has excessive delays in the output which requires special
+handling.
+Arguments are the same as send_command_timing() method.
Source code
def send_command_w_enter(self, *args: Any, **kwargs: Any) -> str:
"""
For 'show run-config' Cisco WLC adds a 'Press Enter to continue...' message
- Even though pagination is disabled
+ Even though pagination is disabled.
+
show run-config also has excessive delays in the output which requires special
handling.
- Arguments are the same as send_command_timing() method
+
+ Arguments are the same as send_command_timing() method.
"""
if len(args) > 1:
raise ValueError("Must pass in delay_factor as keyword argument")
@@ -733,17 +791,18 @@ Methods
kwargs["delay_factor"] = self.select_delay_factor(delay_factor)
output = self._send_command_timing_str(*args, **kwargs)
+ second_args = list(args)
+ if len(args) == 1:
+ second_args[0] = self.RETURN
+ else:
+ kwargs["command_string"] = self.RETURN
+ if not kwargs.get("max_loops"):
+ kwargs["max_loops"] = 150
+
if "Press any key" in output or "Press Enter to" in output:
- new_args = list(args)
- if len(args) == 1:
- new_args[0] = self.RETURN
- else:
- kwargs["command_string"] = self.RETURN
- if not kwargs.get("max_loops"):
- kwargs["max_loops"] = 150
# Send an 'enter'
- output += self._send_command_timing_str(*new_args, **kwargs)
+ output += self._send_command_timing_str(*second_args, **kwargs)
# WLC has excessive delay after this appears on screen
if "802.11b Advanced Configuration" in output:
@@ -770,34 +829,6 @@ Methods
return output
-
-def send_command_w_yes (self, *args, **kwargs)
-
-
-For 'show interface summary' Cisco WLC adds a
-'Would you like to display the next 15 entries?' message
-Even though pagination is disabled
-Arguments are the same as send_command_timing() method
-
-Source code
-def send_command_w_yes(self, *args: Any, **kwargs: Any) -> str:
- """
- For 'show interface summary' Cisco WLC adds a
- 'Would you like to display the next 15 entries?' message
- Even though pagination is disabled
- Arguments are the same as send_command_timing() method
- """
- output = self._send_command_timing_str(*args, **kwargs)
- if "(y/n)" in output:
- output += self._send_command_timing_str("y")
- strip_prompt = kwargs.get("strip_prompt", True)
- if strip_prompt:
- # Had to strip trailing prompt twice.
- output = self.strip_prompt(output)
- output = self.strip_prompt(output)
- return output
-
-
def session_preparation (self)
@@ -934,7 +965,6 @@ save_config
send_command_w_enter
-send_command_w_yes
session_preparation
special_login_handler
diff --git a/docs/netmiko/cisco/cisco_xr.html b/docs/netmiko/cisco/cisco_xr.html
index d93a0dee1..e59c9a1c5 100644
--- a/docs/netmiko/cisco/cisco_xr.html
+++ b/docs/netmiko/cisco/cisco_xr.html
@@ -44,6 +44,27 @@ Module netmiko.cisco.cisco_xr
self._test_channel_read(pattern=r"[>#]")
self.set_base_prompt()
+ def set_base_prompt(
+ self,
+ pri_prompt_terminator: str = "#",
+ alt_prompt_terminator: str = ">",
+ delay_factor: float = 1.0,
+ pattern: Optional[str] = None,
+ ) -> str:
+ """
+ Cisco IOS-XR abbreviates the prompt at 31-chars in config mode.
+
+ Consequently, abbreviate the base_prompt
+ """
+ base_prompt = super().set_base_prompt(
+ pri_prompt_terminator=pri_prompt_terminator,
+ alt_prompt_terminator=alt_prompt_terminator,
+ delay_factor=delay_factor,
+ pattern=pattern,
+ )
+ self.base_prompt = base_prompt[:31]
+ return self.base_prompt
+
def send_config_set(
self,
config_commands: Union[str, Sequence[str], TextIO, None] = None,
@@ -395,6 +416,27 @@
self._test_channel_read(pattern=r"[>#]")
self.set_base_prompt()
+ def set_base_prompt(
+ self,
+ pri_prompt_terminator: str = "#",
+ alt_prompt_terminator: str = ">",
+ delay_factor: float = 1.0,
+ pattern: Optional[str] = None,
+ ) -> str:
+ """
+ Cisco IOS-XR abbreviates the prompt at 31-chars in config mode.
+
+ Consequently, abbreviate the base_prompt
+ """
+ base_prompt = super().set_base_prompt(
+ pri_prompt_terminator=pri_prompt_terminator,
+ alt_prompt_terminator=alt_prompt_terminator,
+ delay_factor=delay_factor,
+ pattern=pattern,
+ )
+ self.base_prompt = base_prompt[:31]
+ return self.base_prompt
+
def send_config_set(
self,
config_commands: Union[str, Sequence[str], TextIO, None] = None,
@@ -822,6 +864,36 @@ Methods
self.set_base_prompt()
+
+def set_base_prompt (self, pri_prompt_terminator='#', alt_prompt_terminator='>', delay_factor=1.0, pattern=None)
+
+
+Cisco IOS-XR abbreviates the prompt at 31-chars in config mode.
+Consequently, abbreviate the base_prompt
+
+Source code
+def set_base_prompt(
+ self,
+ pri_prompt_terminator: str = "#",
+ alt_prompt_terminator: str = ">",
+ delay_factor: float = 1.0,
+ pattern: Optional[str] = None,
+) -> str:
+ """
+ Cisco IOS-XR abbreviates the prompt at 31-chars in config mode.
+
+ Consequently, abbreviate the base_prompt
+ """
+ base_prompt = super().set_base_prompt(
+ pri_prompt_terminator=pri_prompt_terminator,
+ alt_prompt_terminator=alt_prompt_terminator,
+ delay_factor=delay_factor,
+ pattern=pattern,
+ )
+ self.base_prompt = base_prompt[:31]
+ return self.base_prompt
+
+
Inherited members
diff --git a/docs/netmiko/cisco/index.html b/docs/netmiko/cisco/index.html
index 5b928666c..c1a3f6040 100644
--- a/docs/netmiko/cisco/index.html
+++ b/docs/netmiko/cisco/index.html
@@ -1023,7 +1023,30 @@ Inherited members
self.disable_paging()
self.set_base_prompt()
- def check_config_mode(self, check_string: str = ")#", pattern: str = r"#") -> bool:
+ def set_base_prompt(
+ self,
+ pri_prompt_terminator: str = "#",
+ alt_prompt_terminator: str = ">",
+ delay_factor: float = 1.0,
+ pattern: Optional[str] = None,
+ ) -> str:
+ """
+ Cisco IOS/IOS-XE abbreviates the prompt at 20-chars in config mode.
+
+ Consequently, abbreviate the base_prompt
+ """
+ base_prompt = super().set_base_prompt(
+ pri_prompt_terminator=pri_prompt_terminator,
+ alt_prompt_terminator=alt_prompt_terminator,
+ delay_factor=delay_factor,
+ pattern=pattern,
+ )
+ self.base_prompt = base_prompt[:16]
+ return self.base_prompt
+
+ def check_config_mode(
+ self, check_string: str = ")#", pattern: str = r"[>#]"
+ ) -> bool:
"""
Checks if the device is in configuration mode or not.
@@ -1085,6 +1108,36 @@ Methods
self.set_base_prompt()
+
+def set_base_prompt (self, pri_prompt_terminator='#', alt_prompt_terminator='>', delay_factor=1.0, pattern=None)
+
+
+Cisco IOS/IOS-XE abbreviates the prompt at 20-chars in config mode.
+Consequently, abbreviate the base_prompt
+
+Source code
+def set_base_prompt(
+ self,
+ pri_prompt_terminator: str = "#",
+ alt_prompt_terminator: str = ">",
+ delay_factor: float = 1.0,
+ pattern: Optional[str] = None,
+) -> str:
+ """
+ Cisco IOS/IOS-XE abbreviates the prompt at 20-chars in config mode.
+
+ Consequently, abbreviate the base_prompt
+ """
+ base_prompt = super().set_base_prompt(
+ pri_prompt_terminator=pri_prompt_terminator,
+ alt_prompt_terminator=alt_prompt_terminator,
+ delay_factor=delay_factor,
+ pattern=pattern,
+ )
+ self.base_prompt = base_prompt[:16]
+ return self.base_prompt
+
+
Inherited members
@@ -1120,7 +1173,6 @@ Inherited members
send_config_from_file
send_config_set
send_multiline
-set_base_prompt
set_terminal_width
special_login_handler
strip_ansi_escape_codes
@@ -1338,7 +1390,7 @@ Inherited members
send_config_set
send_multiline
session_preparation
-set_base_prompt
+set_base_prompt
set_terminal_width
special_login_handler
strip_ansi_escape_codes
@@ -1509,7 +1561,7 @@ Inherited members
send_config_set
send_multiline
session_preparation
-set_base_prompt
+set_base_prompt
set_terminal_width
special_login_handler
strip_ansi_escape_codes
@@ -1680,7 +1732,7 @@ Inherited members
send_config_set
send_multiline
session_preparation
-set_base_prompt
+set_base_prompt
set_terminal_width
special_login_handler
strip_ansi_escape_codes
@@ -1987,7 +2039,9 @@ Inherited members
# NX-OS fix for incorrect MD5 on 9K (due to strange <enter> patterns on NX-OS)
return newline.sub(self.RESPONSE_RETURN, a_string).replace("\r", "\n")
- def check_config_mode(self, check_string: str = ")#", pattern: str = "#") -> bool:
+ def check_config_mode(
+ self, check_string: str = ")#", pattern: str = r"[>#]"
+ ) -> bool:
"""Checks if the device is in configuration mode or not."""
return super().check_config_mode(check_string=check_string, pattern=pattern)
@@ -2032,13 +2086,15 @@ Ancestors
Methods
-def check_config_mode (self, check_string=')#', pattern='#')
+def check_config_mode (self, check_string=')#', pattern='[>#]')
Checks if the device is in configuration mode or not.
Source code
-def check_config_mode(self, check_string: str = ")#", pattern: str = "#") -> bool:
+def check_config_mode(
+ self, check_string: str = ")#", pattern: str = r"[>#]"
+) -> bool:
"""Checks if the device is in configuration mode or not."""
return super().check_config_mode(check_string=check_string, pattern=pattern)
@@ -3320,10 +3376,12 @@ Inherited members
def send_command_w_enter(self, *args: Any, **kwargs: Any) -> str:
"""
For 'show run-config' Cisco WLC adds a 'Press Enter to continue...' message
- Even though pagination is disabled
+ Even though pagination is disabled.
+
show run-config also has excessive delays in the output which requires special
handling.
- Arguments are the same as send_command_timing() method
+
+ Arguments are the same as send_command_timing() method.
"""
if len(args) > 1:
raise ValueError("Must pass in delay_factor as keyword argument")
@@ -3333,17 +3391,18 @@ Inherited members
kwargs["delay_factor"] = self.select_delay_factor(delay_factor)
output = self._send_command_timing_str(*args, **kwargs)
+ second_args = list(args)
+ if len(args) == 1:
+ second_args[0] = self.RETURN
+ else:
+ kwargs["command_string"] = self.RETURN
+ if not kwargs.get("max_loops"):
+ kwargs["max_loops"] = 150
+
if "Press any key" in output or "Press Enter to" in output:
- new_args = list(args)
- if len(args) == 1:
- new_args[0] = self.RETURN
- else:
- kwargs["command_string"] = self.RETURN
- if not kwargs.get("max_loops"):
- kwargs["max_loops"] = 150
# Send an 'enter'
- output += self._send_command_timing_str(*new_args, **kwargs)
+ output += self._send_command_timing_str(*second_args, **kwargs)
# WLC has excessive delay after this appears on screen
if "802.11b Advanced Configuration" in output:
@@ -3369,17 +3428,42 @@ Inherited members
output = self.strip_prompt(output)
return output
- def send_command_w_yes(self, *args: Any, **kwargs: Any) -> str:
+ def _send_command_w_yes(self, *args: Any, **kwargs: Any) -> str:
"""
For 'show interface summary' Cisco WLC adds a
- 'Would you like to display the next 15 entries?' message
+ 'Would you like to display the next 15 entries?' message.
+
Even though pagination is disabled
- Arguments are the same as send_command_timing() method
+ Arguments are the same as send_command_timing() method.
"""
- output = self._send_command_timing_str(*args, **kwargs)
- if "(y/n)" in output:
- output += self._send_command_timing_str("y")
+ if len(args) > 1:
+ raise ValueError("Must pass in delay_factor as keyword argument")
+
+ # If no delay_factor use 1 for default value
+ delay_factor = kwargs.get("delay_factor", 1)
+ kwargs["delay_factor"] = self.select_delay_factor(delay_factor)
+
+ output = ""
+ new_output = self._send_command_timing_str(*args, **kwargs)
+
+ second_args = list(args)
+ if len(args) == 1:
+ second_args[0] = "y"
+ else:
+ kwargs["command_string"] = "y"
strip_prompt = kwargs.get("strip_prompt", True)
+
+ while True:
+ output += new_output
+ if "display the next" in new_output.lower():
+ new_output = self._send_command_timing_str(*second_args, **kwargs)
+ else:
+ break
+
+ # Remove from output 'Would you like to display the next 15 entries? (y/n)'
+ pattern = r"^.*display the next.*\n$"
+ output = re.sub(pattern, "", output, flags=re.M)
+
if strip_prompt:
# Had to strip trailing prompt twice.
output = self.strip_prompt(output)
@@ -3619,19 +3703,21 @@ Methods
For 'show run-config' Cisco WLC adds a 'Press Enter to continue…' message
-Even though pagination is disabled
-show run-config also has excessive delays in the output which requires special
-handling.
-Arguments are the same as send_command_timing() method
+Even though pagination is disabled.
+show run-config also has excessive delays in the output which requires special
+handling.
+Arguments are the same as send_command_timing() method.
Source code
def send_command_w_enter(self, *args: Any, **kwargs: Any) -> str:
"""
For 'show run-config' Cisco WLC adds a 'Press Enter to continue...' message
- Even though pagination is disabled
+ Even though pagination is disabled.
+
show run-config also has excessive delays in the output which requires special
handling.
- Arguments are the same as send_command_timing() method
+
+ Arguments are the same as send_command_timing() method.
"""
if len(args) > 1:
raise ValueError("Must pass in delay_factor as keyword argument")
@@ -3641,17 +3727,18 @@ Methods
kwargs["delay_factor"] = self.select_delay_factor(delay_factor)
output = self._send_command_timing_str(*args, **kwargs)
+ second_args = list(args)
+ if len(args) == 1:
+ second_args[0] = self.RETURN
+ else:
+ kwargs["command_string"] = self.RETURN
+ if not kwargs.get("max_loops"):
+ kwargs["max_loops"] = 150
+
if "Press any key" in output or "Press Enter to" in output:
- new_args = list(args)
- if len(args) == 1:
- new_args[0] = self.RETURN
- else:
- kwargs["command_string"] = self.RETURN
- if not kwargs.get("max_loops"):
- kwargs["max_loops"] = 150
# Send an 'enter'
- output += self._send_command_timing_str(*new_args, **kwargs)
+ output += self._send_command_timing_str(*second_args, **kwargs)
# WLC has excessive delay after this appears on screen
if "802.11b Advanced Configuration" in output:
@@ -3678,34 +3765,6 @@ Methods
return output
-
-def send_command_w_yes (self, *args, **kwargs)
-
-
-For 'show interface summary' Cisco WLC adds a
-'Would you like to display the next 15 entries?' message
-Even though pagination is disabled
-Arguments are the same as send_command_timing() method
-
-Source code
-def send_command_w_yes(self, *args: Any, **kwargs: Any) -> str:
- """
- For 'show interface summary' Cisco WLC adds a
- 'Would you like to display the next 15 entries?' message
- Even though pagination is disabled
- Arguments are the same as send_command_timing() method
- """
- output = self._send_command_timing_str(*args, **kwargs)
- if "(y/n)" in output:
- output += self._send_command_timing_str("y")
- strip_prompt = kwargs.get("strip_prompt", True)
- if strip_prompt:
- # Had to strip trailing prompt twice.
- output = self.strip_prompt(output)
- output = self.strip_prompt(output)
- return output
-
-
def session_preparation (self)
@@ -4115,7 +4174,7 @@ Inherited members
send_config_set
send_multiline
session_preparation
-set_base_prompt
+set_base_prompt
set_terminal_width
special_login_handler
strip_ansi_escape_codes
@@ -4286,7 +4345,7 @@ Inherited members
send_config_set
send_multiline
session_preparation
-set_base_prompt
+set_base_prompt
set_terminal_width
special_login_handler
strip_ansi_escape_codes
@@ -4633,6 +4692,7 @@
@@ -4697,7 +4757,6 @@
save_config
send_command_w_enter
-send_command_w_yes
session_preparation
special_login_handler
diff --git a/docs/netmiko/cisco_base_connection.html b/docs/netmiko/cisco_base_connection.html
index c16efae55..01aa04af5 100644
--- a/docs/netmiko/cisco_base_connection.html
+++ b/docs/netmiko/cisco_base_connection.html
@@ -216,8 +216,7 @@ Module netmiko.cisco_base_connection
def cleanup(self, command: str = "exit") -> None:
"""Gracefully exit the SSH session."""
try:
- # The pattern="" forces use of send_command_timing
- if self.check_config_mode(pattern=""):
+ if self.check_config_mode():
self.exit_config_mode()
except Exception:
pass
@@ -593,8 +592,7 @@
def cleanup(self, command: str = "exit") -> None:
"""Gracefully exit the SSH session."""
try:
- # The pattern="" forces use of send_command_timing
- if self.check_config_mode(pattern=""):
+ if self.check_config_mode():
self.exit_config_mode()
except Exception:
pass
@@ -722,8 +720,7 @@ Methods
def cleanup(self, command: str = "exit") -> None:
"""Gracefully exit the SSH session."""
try:
- # The pattern="" forces use of send_command_timing
- if self.check_config_mode(pattern=""):
+ if self.check_config_mode():
self.exit_config_mode()
except Exception:
pass
@@ -734,7 +731,7 @@ Methods
-def enable (self, cmd='enable', pattern='ssword', enable_pattern=None, re_flags=)
+def enable (self, cmd='enable', pattern='ssword', enable_pattern=None, re_flags=re.IGNORECASE)
diff --git a/docs/netmiko/dell/dell_isilon_ssh.html b/docs/netmiko/dell/dell_isilon_ssh.html
index 97f892aa0..27a5881f9 100644
--- a/docs/netmiko/dell/dell_isilon_ssh.html
+++ b/docs/netmiko/dell/dell_isilon_ssh.html
@@ -362,7 +362,7 @@ Methods
-def config_mode (self, config_command='sudo su', pattern='ssword', re_flags=)
+def config_mode (self, config_command='sudo su', pattern='ssword', re_flags=re.IGNORECASE)
Use equivalent enable method.
diff --git a/docs/netmiko/dell/index.html b/docs/netmiko/dell/index.html
index fb4385e7d..59e1a7d1d 100644
--- a/docs/netmiko/dell/index.html
+++ b/docs/netmiko/dell/index.html
@@ -849,7 +849,7 @@ Methods
-def config_mode (self, config_command='sudo su', pattern='ssword', re_flags=)
+def config_mode (self, config_command='sudo su', pattern='ssword', re_flags=re.IGNORECASE)
Use equivalent enable method.
diff --git a/docs/netmiko/extreme/extreme_exos.html b/docs/netmiko/extreme/extreme_exos.html
index 17a149b9a..c8295b8dc 100644
--- a/docs/netmiko/extreme/extreme_exos.html
+++ b/docs/netmiko/extreme/extreme_exos.html
@@ -40,7 +40,7 @@ Module netmiko.extreme.extreme_exos
"""
def session_preparation(self) -> None:
- self._test_channel_read(pattern=r"#")
+ self._test_channel_read(pattern=r"[>\#]")
self.set_base_prompt()
self.disable_paging(command="disable clipaging")
self.send_command_timing("disable cli prompting")
@@ -371,7 +371,7 @@
"""
def session_preparation(self) -> None:
- self._test_channel_read(pattern=r"#")
+ self._test_channel_read(pattern=r"[>\#]")
self.set_base_prompt()
self.disable_paging(command="disable clipaging")
self.send_command_timing("disable cli prompting")
diff --git a/docs/netmiko/hp/hp_comware.html b/docs/netmiko/hp/hp_comware.html
index 8d615db8d..1b393cd8a 100644
--- a/docs/netmiko/hp/hp_comware.html
+++ b/docs/netmiko/hp/hp_comware.html
@@ -446,7 +446,7 @@ Methods
-def enable (self, cmd='system-view', pattern='ssword', enable_pattern=None, re_flags=)
+def enable (self, cmd='system-view', pattern='ssword', enable_pattern=None, re_flags=re.IGNORECASE)
enable mode on Comware is system-view.
diff --git a/docs/netmiko/hp/hp_procurve.html b/docs/netmiko/hp/hp_procurve.html
index 3b7d835fb..6dc186452 100644
--- a/docs/netmiko/hp/hp_procurve.html
+++ b/docs/netmiko/hp/hp_procurve.html
@@ -43,13 +43,30 @@ Module netmiko.hp.hp_procurve
# HP output contains VT100 escape codes
self.ansi_escape_codes = True
- # Procurve over SSH uses 'Press any key to continue'
- data = self._test_channel_read(pattern=r"(any key to continue|[>#])")
- if "any key to continue" in data:
- self.write_channel(self.RETURN)
- self._test_channel_read(pattern=r"[>#]")
+ # ProCurve has an odd behavior where the router prompt can show up
+ # before the 'Press any key to continue' message. Read up until the
+ # Copyright banner to get past this.
+ try:
+ self.read_until_pattern(pattern=r".*opyright", read_timeout=1.3)
+ except ReadTimeout:
+ pass
+
+ # Procurve uses 'Press any key to continue'
+ try:
+ data = self.read_until_pattern(
+ pattern=r"(any key to continue|[>#])", read_timeout=3.0
+ )
+ if "any key to continue" in data:
+ self.write_channel(self.RETURN)
+ self.read_until_pattern(pattern=r"[>#]", read_timeout=3.0)
+ except ReadTimeout:
+ pass
self.set_base_prompt()
+ # If prompt still looks odd, try one more time
+ if len(self.base_prompt) >= 25:
+ self.set_base_prompt()
+
self.set_terminal_width(command="terminal width 511", pattern="terminal")
command = self.RETURN + "no page"
self.disable_paging(command=command)
@@ -342,13 +359,30 @@
# HP output contains VT100 escape codes
self.ansi_escape_codes = True
- # Procurve over SSH uses 'Press any key to continue'
- data = self._test_channel_read(pattern=r"(any key to continue|[>#])")
- if "any key to continue" in data:
- self.write_channel(self.RETURN)
- self._test_channel_read(pattern=r"[>#]")
+ # ProCurve has an odd behavior where the router prompt can show up
+ # before the 'Press any key to continue' message. Read up until the
+ # Copyright banner to get past this.
+ try:
+ self.read_until_pattern(pattern=r".*opyright", read_timeout=1.3)
+ except ReadTimeout:
+ pass
+
+ # Procurve uses 'Press any key to continue'
+ try:
+ data = self.read_until_pattern(
+ pattern=r"(any key to continue|[>#])", read_timeout=3.0
+ )
+ if "any key to continue" in data:
+ self.write_channel(self.RETURN)
+ self.read_until_pattern(pattern=r"[>#]", read_timeout=3.0)
+ except ReadTimeout:
+ pass
self.set_base_prompt()
+ # If prompt still looks odd, try one more time
+ if len(self.base_prompt) >= 25:
+ self.set_base_prompt()
+
self.set_terminal_width(command="terminal width 511", pattern="terminal")
command = self.RETURN + "no page"
self.disable_paging(command=command)
@@ -502,7 +536,7 @@ Methods
-def enable (self, cmd='enable', pattern='password', enable_pattern=None, re_flags=, default_username='manager')
+def enable (self, cmd='enable', pattern='password', enable_pattern=None, re_flags=re.IGNORECASE, default_username='manager')
@@ -595,13 +629,30 @@ Methods
# HP output contains VT100 escape codes
self.ansi_escape_codes = True
- # Procurve over SSH uses 'Press any key to continue'
- data = self._test_channel_read(pattern=r"(any key to continue|[>#])")
- if "any key to continue" in data:
- self.write_channel(self.RETURN)
- self._test_channel_read(pattern=r"[>#]")
+ # ProCurve has an odd behavior where the router prompt can show up
+ # before the 'Press any key to continue' message. Read up until the
+ # Copyright banner to get past this.
+ try:
+ self.read_until_pattern(pattern=r".*opyright", read_timeout=1.3)
+ except ReadTimeout:
+ pass
+
+ # Procurve uses 'Press any key to continue'
+ try:
+ data = self.read_until_pattern(
+ pattern=r"(any key to continue|[>#])", read_timeout=3.0
+ )
+ if "any key to continue" in data:
+ self.write_channel(self.RETURN)
+ self.read_until_pattern(pattern=r"[>#]", read_timeout=3.0)
+ except ReadTimeout:
+ pass
self.set_base_prompt()
+ # If prompt still looks odd, try one more time
+ if len(self.base_prompt) >= 25:
+ self.set_base_prompt()
+
self.set_terminal_width(command="terminal width 511", pattern="terminal")
command = self.RETURN + "no page"
self.disable_paging(command=command)
diff --git a/docs/netmiko/huawei/huawei.html b/docs/netmiko/huawei/huawei.html
index cbbc81653..24cbd3df7 100644
--- a/docs/netmiko/huawei/huawei.html
+++ b/docs/netmiko/huawei/huawei.html
@@ -38,7 +38,7 @@ Module netmiko.huawei.huawei
def session_preparation(self) -> None:
"""Prepare the session after the connection has been established."""
self.ansi_escape_codes = True
- self._test_channel_read(pattern=r"[>\]]")
+ # The _test_channel_read happens in special_login_handler()
self.set_base_prompt()
self.disable_paging(command="screen-length 0 temporary")
@@ -122,15 +122,14 @@ Module netmiko.huawei.huawei
"""Huawei SSH driver."""
def special_login_handler(self, delay_factor: float = 1.0) -> None:
- """Handle password change request by ignoring it"""
-
- # Huawei can prompt for password change. Search for that or for normal prompt
- password_change_prompt = r"((Change now|Please choose))|([\]>]\s*$)"
- output = self.read_until_pattern(password_change_prompt)
- if re.search(password_change_prompt, output):
- self.write_channel("N\n")
- self.clear_buffer()
- return None
+ # Huawei prompts for password change before displaying the initial base prompt.
+ # Search for that password change prompt or for base prompt.
+ password_change_prompt = r"(Change now|Please choose)"
+ prompt_or_password_change = r"(?:Change now|Please choose|[>\]])"
+ data = self.read_until_pattern(pattern=prompt_or_password_change)
+ if re.search(password_change_prompt, data):
+ self.write_channel("N" + self.RETURN)
+ self.read_until_pattern(pattern=r"[>\]]")
class HuaweiTelnet(HuaweiBase):
@@ -393,7 +392,7 @@
def session_preparation(self) -> None:
"""Prepare the session after the connection has been established."""
self.ansi_escape_codes = True
- self._test_channel_read(pattern=r"[>\]]")
+ # The _test_channel_read happens in special_login_handler()
self.set_base_prompt()
self.disable_paging(command="screen-length 0 temporary")
@@ -535,7 +534,7 @@ Methods
def session_preparation(self) -> None:
"""Prepare the session after the connection has been established."""
self.ansi_escape_codes = True
- self._test_channel_read(pattern=r"[>\]]")
+ # The _test_channel_read happens in special_login_handler()
self.set_base_prompt()
self.disable_paging(command="screen-length 0 temporary")
@@ -770,15 +769,14 @@ Inherited members
"""Huawei SSH driver."""
def special_login_handler(self, delay_factor: float = 1.0) -> None:
- """Handle password change request by ignoring it"""
-
- # Huawei can prompt for password change. Search for that or for normal prompt
- password_change_prompt = r"((Change now|Please choose))|([\]>]\s*$)"
- output = self.read_until_pattern(password_change_prompt)
- if re.search(password_change_prompt, output):
- self.write_channel("N\n")
- self.clear_buffer()
- return None
+ # Huawei prompts for password change before displaying the initial base prompt.
+ # Search for that password change prompt or for base prompt.
+ password_change_prompt = r"(Change now|Please choose)"
+ prompt_or_password_change = r"(?:Change now|Please choose|[>\]])"
+ data = self.read_until_pattern(pattern=prompt_or_password_change)
+ if re.search(password_change_prompt, data):
+ self.write_channel("N" + self.RETURN)
+ self.read_until_pattern(pattern=r"[>\]]")
Ancestors
@@ -791,28 +789,6 @@ Subclasses
-Methods
-
-
-def special_login_handler (self, delay_factor=1.0)
-
-
-Handle password change request by ignoring it
-
-Source code
-def special_login_handler(self, delay_factor: float = 1.0) -> None:
- """Handle password change request by ignoring it"""
-
- # Huawei can prompt for password change. Search for that or for normal prompt
- password_change_prompt = r"((Change now|Please choose))|([\]>]\s*$)"
- output = self.read_until_pattern(password_change_prompt)
- if re.search(password_change_prompt, output):
- self.write_channel("N\n")
- self.clear_buffer()
- return None
-
-
-
Inherited members
HuaweiBase
:
@@ -851,6 +827,7 @@ Inherited members
session_preparation
set_base_prompt
set_terminal_width
+special_login_handler
strip_ansi_escape_codes
strip_backspaces
strip_command
@@ -1469,7 +1446,7 @@ Inherited members
session_preparation
set_base_prompt
set_terminal_width
-special_login_handler
+special_login_handler
strip_ansi_escape_codes
strip_backspaces
strip_command
@@ -1509,9 +1486,6 @@
-
diff --git a/docs/netmiko/huawei/index.html b/docs/netmiko/huawei/index.html
index 1cf1126ac..0f2cfe0aa 100644
--- a/docs/netmiko/huawei/index.html
+++ b/docs/netmiko/huawei/index.html
@@ -164,15 +164,14 @@
"""Huawei SSH driver."""
def special_login_handler(self, delay_factor: float = 1.0) -> None:
- """Handle password change request by ignoring it"""
-
- # Huawei can prompt for password change. Search for that or for normal prompt
- password_change_prompt = r"((Change now|Please choose))|([\]>]\s*$)"
- output = self.read_until_pattern(password_change_prompt)
- if re.search(password_change_prompt, output):
- self.write_channel("N\n")
- self.clear_buffer()
- return None
+ # Huawei prompts for password change before displaying the initial base prompt.
+ # Search for that password change prompt or for base prompt.
+ password_change_prompt = r"(Change now|Please choose)"
+ prompt_or_password_change = r"(?:Change now|Please choose|[>\]])"
+ data = self.read_until_pattern(pattern=prompt_or_password_change)
+ if re.search(password_change_prompt, data):
+ self.write_channel("N" + self.RETURN)
+ self.read_until_pattern(pattern=r"[>\]]")
Ancestors
@@ -185,28 +184,6 @@ Subclasses
-Methods
-
-
-def special_login_handler (self, delay_factor=1.0)
-
-
-Handle password change request by ignoring it
-
-Source code
-def special_login_handler(self, delay_factor: float = 1.0) -> None:
- """Handle password change request by ignoring it"""
-
- # Huawei can prompt for password change. Search for that or for normal prompt
- password_change_prompt = r"((Change now|Please choose))|([\]>]\s*$)"
- output = self.read_until_pattern(password_change_prompt)
- if re.search(password_change_prompt, output):
- self.write_channel("N\n")
- self.clear_buffer()
- return None
-
-
-
Inherited members
HuaweiBase
:
@@ -245,6 +222,7 @@ Inherited members
session_preparation
set_base_prompt
set_terminal_width
+special_login_handler
strip_ansi_escape_codes
strip_backspaces
strip_command
@@ -1197,7 +1175,7 @@ Inherited members
session_preparation
set_base_prompt
set_terminal_width
-special_login_handler
+special_login_handler
strip_ansi_escape_codes
strip_backspaces
strip_command
@@ -1232,9 +1210,6 @@ Index
-
diff --git a/docs/netmiko/index.html b/docs/netmiko/index.html
index cb3c19b2b..afa31819a 100644
--- a/docs/netmiko/index.html
+++ b/docs/netmiko/index.html
@@ -55,7 +55,7 @@ Module netmiko
# Alternate naming
Netmiko = ConnectHandler
-__version__ = "4.0.0"
+__version__ = "4.0.1a1"
__all__ = (
"ConnectHandler",
"ConnLogOnly",
@@ -1365,7 +1365,7 @@
results = re.split(pattern, output, maxsplit=1, flags=re_flags)
# The string matched by pattern must be retained in the output string.
- # re.split will do this if capturing parentesis are used.
+ # re.split will do this if capturing parenthesis are used.
if len(results) == 2:
# no capturing parenthesis, convert and try again.
pattern = f"({pattern})"
@@ -1872,7 +1872,7 @@
time.sleep(main_delay * 10)
new_data = ""
while i <= count:
- new_data += self.read_channel_timing()
+ new_data += self.read_channel_timing(read_timeout=20)
if new_data:
return new_data
@@ -2693,7 +2693,7 @@
self.write_channel(self.RETURN)
# You can encounter an issue here (on router name changes) prefer delay-based solution
if not pattern:
- output = self.read_channel_timing()
+ output = self.read_channel_timing(read_timeout=10.0)
else:
output = self.read_until_pattern(pattern=pattern)
return check_string in output
@@ -3189,7 +3189,7 @@ Methods
self.write_channel(self.RETURN)
# You can encounter an issue here (on router name changes) prefer delay-based solution
if not pattern:
- output = self.read_channel_timing()
+ output = self.read_channel_timing(read_timeout=10.0)
else:
output = self.read_until_pattern(pattern=pattern)
return check_string in output
@@ -3417,7 +3417,7 @@ Methods
-def enable (self, cmd='', pattern='ssword', enable_pattern=None, re_flags=)
+def enable (self, cmd='', pattern='ssword', enable_pattern=None, re_flags=re.IGNORECASE)
Enter enable mode.
@@ -4008,7 +4008,7 @@ Methods
results = re.split(pattern, output, maxsplit=1, flags=re_flags)
# The string matched by pattern must be retained in the output string.
- # re.split will do this if capturing parentesis are used.
+ # re.split will do this if capturing parenthesis are used.
if len(results) == 2:
# no capturing parenthesis, convert and try again.
pattern = f"({pattern})"
diff --git a/docs/netmiko/juniper/juniper.html b/docs/netmiko/juniper/juniper.html
index 16a6cb49c..0f1a29762 100644
--- a/docs/netmiko/juniper/juniper.html
+++ b/docs/netmiko/juniper/juniper.html
@@ -23,7 +23,6 @@ Module netmiko.juniper.juniper
Source code
import re
-import time
import warnings
from typing import Optional, Any
@@ -41,7 +40,10 @@ Module netmiko.juniper.juniper
def session_preparation(self) -> None:
"""Prepare the session after the connection has been established."""
+ pattern = r"[%>$#]"
+ self._test_channel_read(pattern=pattern)
self.enter_cli_mode()
+
cmd = "set cli screen-width 511"
self.set_terminal_width(command=cmd, pattern=r"Screen width set to")
# Overloading disable_paging which is confusing
@@ -62,35 +64,58 @@ Module netmiko.juniper.juniper
"""Return to the Juniper CLI."""
return self._send_command_str("exit", expect_string=r"[#>]")
+ def _determine_mode(self, data: str = "") -> str:
+ """Determine whether in shell or CLI."""
+ pattern = r"[%>$#]"
+ if not data:
+ self.write_channel(self.RETURN)
+ data = self.read_until_pattern(pattern=pattern, read_timeout=10)
+
+ if "%" in data or "$" in data:
+ return "shell"
+ elif ">" in data or "#" in data:
+ return "cli"
+ else:
+ raise ValueError(f"Unexpected data returned for prompt: {data}")
+
def enter_cli_mode(self) -> None:
"""Check if at shell prompt root@ and go into CLI."""
- delay_factor = self.select_delay_factor(delay_factor=0)
- count = 0
- cur_prompt = ""
- while count < 50:
+ mode = self._determine_mode()
+ if mode == "shell":
+ shell_pattern = r"[%$]"
self.write_channel(self.RETURN)
- time.sleep(0.1 * delay_factor)
- cur_prompt = self.read_channel()
+ cur_prompt = self.read_until_pattern(pattern=shell_pattern, read_timeout=10)
if re.search(r"root@", cur_prompt) or re.search(r"^%$", cur_prompt.strip()):
+ cli_pattern = r"[>#]"
self.write_channel("cli" + self.RETURN)
- time.sleep(0.3 * delay_factor)
- self.clear_buffer()
- break
- elif ">" in cur_prompt or "#" in cur_prompt:
- break
- count += 1
+ self.read_until_pattern(pattern=cli_pattern, read_timeout=10)
+ return
- def check_config_mode(self, check_string: str = "]", pattern: str = "") -> bool:
- """Checks if the device is in configuration mode or not."""
- return super().check_config_mode(check_string=check_string)
+ def check_config_mode(
+ self, check_string: str = "]", pattern: str = r"(?m:[>#] $)"
+ ) -> bool:
+ """
+ Checks if the device is in configuration mode or not.
+
+ ?m = Use multiline matching
+
+ Juniper unfortunately will use # as a message indicator when not in config mode
+ For example, with commit confirmed.
+
+ """
+ return super().check_config_mode(check_string=check_string, pattern=pattern)
def config_mode(
self,
config_command: str = "configure",
- pattern: str = r"Entering configuration mode",
+ pattern: str = r"(?s:Entering configuration mode.*\].*#)",
re_flags: int = 0,
) -> str:
- """Enter configuration mode."""
+ """
+ Enter configuration mode.
+
+ ?s = enables re.DOTALL in regex pattern.
+ """
return super().config_mode(
config_command=config_command, pattern=pattern, re_flags=re_flags
)
@@ -101,12 +126,17 @@ Module netmiko.juniper.juniper
"""Exit configuration mode."""
output = ""
if self.check_config_mode():
- output = self._send_command_timing_str(
- exit_config, strip_prompt=False, strip_command=False
+ confirm_msg = "Exit with uncommitted changes"
+ pattern = rf"(?:>|{confirm_msg})"
+ output = self._send_command_str(
+ exit_config,
+ expect_string=pattern,
+ strip_prompt=False,
+ strip_command=False,
)
- if "Exit with uncommitted changes?" in output:
- output += self._send_command_timing_str(
- "yes", strip_prompt=False, strip_command=False
+ if confirm_msg in output:
+ output += self._send_command_str(
+ "yes", expect_string=r">", strip_prompt=False, strip_command=False
)
if self.check_config_mode():
raise ValueError("Failed to exit configuration mode")
@@ -234,8 +264,7 @@ Module netmiko.juniper.juniper
def cleanup(self, command: str = "exit") -> None:
"""Gracefully exit the SSH session."""
try:
- # The pattern="" forces use of send_command_timing
- if self.check_config_mode(pattern=""):
+ if self.check_config_mode():
self.exit_config_mode()
except Exception:
pass
@@ -435,7 +464,10 @@
def session_preparation(self) -> None:
"""Prepare the session after the connection has been established."""
+ pattern = r"[%>$#]"
+ self._test_channel_read(pattern=pattern)
self.enter_cli_mode()
+
cmd = "set cli screen-width 511"
self.set_terminal_width(command=cmd, pattern=r"Screen width set to")
# Overloading disable_paging which is confusing
@@ -456,35 +488,58 @@
"""Return to the Juniper CLI."""
return self._send_command_str("exit", expect_string=r"[#>]")
+ def _determine_mode(self, data: str = "") -> str:
+ """Determine whether in shell or CLI."""
+ pattern = r"[%>$#]"
+ if not data:
+ self.write_channel(self.RETURN)
+ data = self.read_until_pattern(pattern=pattern, read_timeout=10)
+
+ if "%" in data or "$" in data:
+ return "shell"
+ elif ">" in data or "#" in data:
+ return "cli"
+ else:
+ raise ValueError(f"Unexpected data returned for prompt: {data}")
+
def enter_cli_mode(self) -> None:
"""Check if at shell prompt root@ and go into CLI."""
- delay_factor = self.select_delay_factor(delay_factor=0)
- count = 0
- cur_prompt = ""
- while count < 50:
+ mode = self._determine_mode()
+ if mode == "shell":
+ shell_pattern = r"[%$]"
self.write_channel(self.RETURN)
- time.sleep(0.1 * delay_factor)
- cur_prompt = self.read_channel()
+ cur_prompt = self.read_until_pattern(pattern=shell_pattern, read_timeout=10)
if re.search(r"root@", cur_prompt) or re.search(r"^%$", cur_prompt.strip()):
+ cli_pattern = r"[>#]"
self.write_channel("cli" + self.RETURN)
- time.sleep(0.3 * delay_factor)
- self.clear_buffer()
- break
- elif ">" in cur_prompt or "#" in cur_prompt:
- break
- count += 1
+ self.read_until_pattern(pattern=cli_pattern, read_timeout=10)
+ return
+
+ def check_config_mode(
+ self, check_string: str = "]", pattern: str = r"(?m:[>#] $)"
+ ) -> bool:
+ """
+ Checks if the device is in configuration mode or not.
+
+ ?m = Use multiline matching
- def check_config_mode(self, check_string: str = "]", pattern: str = "") -> bool:
- """Checks if the device is in configuration mode or not."""
- return super().check_config_mode(check_string=check_string)
+ Juniper unfortunately will use # as a message indicator when not in config mode
+ For example, with commit confirmed.
+
+ """
+ return super().check_config_mode(check_string=check_string, pattern=pattern)
def config_mode(
self,
config_command: str = "configure",
- pattern: str = r"Entering configuration mode",
+ pattern: str = r"(?s:Entering configuration mode.*\].*#)",
re_flags: int = 0,
) -> str:
- """Enter configuration mode."""
+ """
+ Enter configuration mode.
+
+ ?s = enables re.DOTALL in regex pattern.
+ """
return super().config_mode(
config_command=config_command, pattern=pattern, re_flags=re_flags
)
@@ -495,12 +550,17 @@
"""Exit configuration mode."""
output = ""
if self.check_config_mode():
- output = self._send_command_timing_str(
- exit_config, strip_prompt=False, strip_command=False
+ confirm_msg = "Exit with uncommitted changes"
+ pattern = rf"(?:>|{confirm_msg})"
+ output = self._send_command_str(
+ exit_config,
+ expect_string=pattern,
+ strip_prompt=False,
+ strip_command=False,
)
- if "Exit with uncommitted changes?" in output:
- output += self._send_command_timing_str(
- "yes", strip_prompt=False, strip_command=False
+ if confirm_msg in output:
+ output += self._send_command_str(
+ "yes", expect_string=r">", strip_prompt=False, strip_command=False
)
if self.check_config_mode():
raise ValueError("Failed to exit configuration mode")
@@ -628,8 +688,7 @@
def cleanup(self, command: str = "exit") -> None:
"""Gracefully exit the SSH session."""
try:
- # The pattern="" forces use of send_command_timing
- if self.check_config_mode(pattern=""):
+ if self.check_config_mode():
self.exit_config_mode()
except Exception:
pass
@@ -650,15 +709,28 @@ Subclasses
Methods
-def check_config_mode (self, check_string=']', pattern='')
+def check_config_mode (self, check_string=']', pattern='(?m:[>#] $)')
-Checks if the device is in configuration mode or not.
+Checks if the device is in configuration mode or not.
+?m = Use multiline matching
+Juniper unfortunately will use # as a message indicator when not in config mode
+For example, with commit confirmed.
Source code
-def check_config_mode(self, check_string: str = "]", pattern: str = "") -> bool:
- """Checks if the device is in configuration mode or not."""
- return super().check_config_mode(check_string=check_string)
+def check_config_mode(
+ self, check_string: str = "]", pattern: str = r"(?m:[>#] $)"
+) -> bool:
+ """
+ Checks if the device is in configuration mode or not.
+
+ ?m = Use multiline matching
+
+ Juniper unfortunately will use # as a message indicator when not in config mode
+ For example, with commit confirmed.
+
+ """
+ return super().check_config_mode(check_string=check_string, pattern=pattern)
@@ -671,8 +743,7 @@ Methods
def cleanup(self, command: str = "exit") -> None:
"""Gracefully exit the SSH session."""
try:
- # The pattern="" forces use of send_command_timing
- if self.check_config_mode(pattern=""):
+ if self.check_config_mode():
self.exit_config_mode()
except Exception:
pass
@@ -792,19 +863,24 @@ Methods
-def config_mode (self, config_command='configure', pattern='Entering configuration mode', re_flags=0)
+def config_mode (self, config_command='configure', pattern='(?s:Entering configuration mode.*\\].*#)', re_flags=0)
-Enter configuration mode.
+Enter configuration mode.
+?s = enables re.DOTALL in regex pattern.
Source code
def config_mode(
self,
config_command: str = "configure",
- pattern: str = r"Entering configuration mode",
+ pattern: str = r"(?s:Entering configuration mode.*\].*#)",
re_flags: int = 0,
) -> str:
- """Enter configuration mode."""
+ """
+ Enter configuration mode.
+
+ ?s = enables re.DOTALL in regex pattern.
+ """
return super().config_mode(
config_command=config_command, pattern=pattern, re_flags=re_flags
)
@@ -819,21 +895,16 @@ Methods
Source code
def enter_cli_mode(self) -> None:
"""Check if at shell prompt root@ and go into CLI."""
- delay_factor = self.select_delay_factor(delay_factor=0)
- count = 0
- cur_prompt = ""
- while count < 50:
+ mode = self._determine_mode()
+ if mode == "shell":
+ shell_pattern = r"[%$]"
self.write_channel(self.RETURN)
- time.sleep(0.1 * delay_factor)
- cur_prompt = self.read_channel()
+ cur_prompt = self.read_until_pattern(pattern=shell_pattern, read_timeout=10)
if re.search(r"root@", cur_prompt) or re.search(r"^%$", cur_prompt.strip()):
+ cli_pattern = r"[>#]"
self.write_channel("cli" + self.RETURN)
- time.sleep(0.3 * delay_factor)
- self.clear_buffer()
- break
- elif ">" in cur_prompt or "#" in cur_prompt:
- break
- count += 1
+ self.read_until_pattern(pattern=cli_pattern, read_timeout=10)
+ return
@@ -849,12 +920,17 @@ Methods
"""Exit configuration mode."""
output = ""
if self.check_config_mode():
- output = self._send_command_timing_str(
- exit_config, strip_prompt=False, strip_command=False
+ confirm_msg = "Exit with uncommitted changes"
+ pattern = rf"(?:>|{confirm_msg})"
+ output = self._send_command_str(
+ exit_config,
+ expect_string=pattern,
+ strip_prompt=False,
+ strip_command=False,
)
- if "Exit with uncommitted changes?" in output:
- output += self._send_command_timing_str(
- "yes", strip_prompt=False, strip_command=False
+ if confirm_msg in output:
+ output += self._send_command_str(
+ "yes", expect_string=r">", strip_prompt=False, strip_command=False
)
if self.check_config_mode():
raise ValueError("Failed to exit configuration mode")
@@ -870,7 +946,10 @@ Methods
Source code
def session_preparation(self) -> None:
"""Prepare the session after the connection has been established."""
+ pattern = r"[%>$#]"
+ self._test_channel_read(pattern=pattern)
self.enter_cli_mode()
+
cmd = "set cli screen-width 511"
self.set_terminal_width(command=cmd, pattern=r"Screen width set to")
# Overloading disable_paging which is confusing
diff --git a/docs/netmiko/keymile/index.html b/docs/netmiko/keymile/index.html
index 528bda949..3296ce928 100644
--- a/docs/netmiko/keymile/index.html
+++ b/docs/netmiko/keymile/index.html
@@ -245,7 +245,7 @@ Inherited members
send_config_set
send_multiline
session_preparation
-set_base_prompt
+set_base_prompt
set_terminal_width
strip_ansi_escape_codes
strip_backspaces
diff --git a/docs/netmiko/keymile/keymile_nos_ssh.html b/docs/netmiko/keymile/keymile_nos_ssh.html
index 766fb2325..374a69b35 100644
--- a/docs/netmiko/keymile/keymile_nos_ssh.html
+++ b/docs/netmiko/keymile/keymile_nos_ssh.html
@@ -264,7 +264,7 @@ Inherited members
send_config_set
send_multiline
session_preparation
-set_base_prompt
+set_base_prompt
set_terminal_width
strip_ansi_escape_codes
strip_backspaces
diff --git a/docs/netmiko/linux/index.html b/docs/netmiko/linux/index.html
index 4a2afa66d..6fe789b5d 100644
--- a/docs/netmiko/linux/index.html
+++ b/docs/netmiko/linux/index.html
@@ -432,7 +432,7 @@ Methods
-def config_mode (self, config_command='sudo -s', pattern='ssword', re_flags=)
+def config_mode (self, config_command='sudo -s', pattern='ssword', re_flags=re.IGNORECASE)
@@ -461,7 +461,7 @@ Methods
-def enable (self, cmd='sudo -s', pattern='ssword', enable_pattern=None, re_flags=)
+def enable (self, cmd='sudo -s', pattern='ssword', enable_pattern=None, re_flags=re.IGNORECASE)
diff --git a/docs/netmiko/linux/linux_ssh.html b/docs/netmiko/linux/linux_ssh.html
index 6f2fdc570..25100cdd1 100644
--- a/docs/netmiko/linux/linux_ssh.html
+++ b/docs/netmiko/linux/linux_ssh.html
@@ -627,7 +627,7 @@ Methods
-def config_mode (self, config_command='sudo -s', pattern='ssword', re_flags=)
+def config_mode (self, config_command='sudo -s', pattern='ssword', re_flags=re.IGNORECASE)
@@ -656,7 +656,7 @@ Methods
-def enable (self, cmd='sudo -s', pattern='ssword', enable_pattern=None, re_flags=)
+def enable (self, cmd='sudo -s', pattern='ssword', enable_pattern=None, re_flags=re.IGNORECASE)
diff --git a/docs/netmiko/mellanox/index.html b/docs/netmiko/mellanox/index.html
index 1576f6efe..b0807fe36 100644
--- a/docs/netmiko/mellanox/index.html
+++ b/docs/netmiko/mellanox/index.html
@@ -248,7 +248,7 @@ Ancestors
Methods
-def enable (self, cmd='enable', pattern='#', enable_pattern=None, re_flags=)
+def enable (self, cmd='enable', pattern='#', enable_pattern=None, re_flags=re.IGNORECASE)
diff --git a/docs/netmiko/mellanox/mellanox_mlnxos_ssh.html b/docs/netmiko/mellanox/mellanox_mlnxos_ssh.html
index 5add9c30e..fd5de7660 100644
--- a/docs/netmiko/mellanox/mellanox_mlnxos_ssh.html
+++ b/docs/netmiko/mellanox/mellanox_mlnxos_ssh.html
@@ -331,7 +331,7 @@ Ancestors
Methods
-def enable (self, cmd='enable', pattern='#', enable_pattern=None, re_flags=)
+def enable (self, cmd='enable', pattern='#', enable_pattern=None, re_flags=re.IGNORECASE)
diff --git a/docs/netmiko/mrv/index.html b/docs/netmiko/mrv/index.html
index 2d7a8c246..9deb65fe5 100644
--- a/docs/netmiko/mrv/index.html
+++ b/docs/netmiko/mrv/index.html
@@ -468,7 +468,7 @@ Ancestors
Methods
-def enable (self, cmd='enable', pattern='#', enable_pattern=None, re_flags=)
+def enable (self, cmd='enable', pattern='#', enable_pattern=None, re_flags=re.IGNORECASE)
Enable mode on MRV uses no password.
diff --git a/docs/netmiko/mrv/mrv_ssh.html b/docs/netmiko/mrv/mrv_ssh.html
index ad9682e6d..f28ade8cd 100644
--- a/docs/netmiko/mrv/mrv_ssh.html
+++ b/docs/netmiko/mrv/mrv_ssh.html
@@ -255,7 +255,7 @@ Ancestors
Methods
-def enable (self, cmd='enable', pattern='#', enable_pattern=None, re_flags=)
+def enable (self, cmd='enable', pattern='#', enable_pattern=None, re_flags=re.IGNORECASE)
Enable mode on MRV uses no password.
diff --git a/docs/netmiko/no_enable.html b/docs/netmiko/no_enable.html
index 6e122505c..63bc944df 100644
--- a/docs/netmiko/no_enable.html
+++ b/docs/netmiko/no_enable.html
@@ -154,7 +154,7 @@ Methods
-def enable (self, cmd='', pattern='', enable_pattern=None, re_flags=)
+def enable (self, cmd='', pattern='', enable_pattern=None, re_flags=re.IGNORECASE)
diff --git a/docs/netmiko/nokia/nokia_sros.html b/docs/netmiko/nokia/nokia_sros.html
index ad7f7f1ac..e8d46e0f4 100644
--- a/docs/netmiko/nokia/nokia_sros.html
+++ b/docs/netmiko/nokia/nokia_sros.html
@@ -24,8 +24,8 @@ Module netmiko.nokia.nokia_sros
Source code
#!/usr/bin/python
# -*- coding: utf-8 -*-
-# Copyright (c) 2014 - 2020 Kirk Byers
-# Copyright (c) 2014 - 2020 Twin Bridges Technology
+# Copyright (c) 2014 - 2022 Kirk Byers
+# Copyright (c) 2014 - 2022 Twin Bridges Technology
# Copyright (c) 2019 - 2020 NOKIA Inc.
# MIT License - See License file at:
# https://github.com/ktbyers/netmiko/blob/develop/LICENSE
@@ -38,6 +38,7 @@ Module netmiko.nokia.nokia_sros
from netmiko import log
from netmiko.base_connection import BaseConnection
from netmiko.scp_handler import BaseFileTransfer
+from netmiko.utilities import nokia_context_filter
class NokiaSros(BaseConnection):
@@ -250,9 +251,13 @@ Module netmiko.nokia.nokia_sros
"""Strip prompt from the output."""
output = super().strip_prompt(*args, **kwargs)
if "@" in self.base_prompt:
- # Remove context prompt too
- strips = r"[\r\n]*\!?\*?(\((ex|gl|pr|ro)\))?\[\S*\][\r\n]*"
- return re.sub(strips, "", output)
+ # Remove Nokia context prompt too
+ output_list = output.rstrip().splitlines()
+ last_line = output_list[-1]
+ other_lines = output_list[:-1]
+ last_line = nokia_context_filter(last_line)
+ output_list = other_lines + [last_line]
+ return "\n".join(output_list).rstrip()
else:
return output
@@ -754,9 +759,13 @@
"""Strip prompt from the output."""
output = super().strip_prompt(*args, **kwargs)
if "@" in self.base_prompt:
- # Remove context prompt too
- strips = r"[\r\n]*\!?\*?(\((ex|gl|pr|ro)\))?\[\S*\][\r\n]*"
- return re.sub(strips, "", output)
+ # Remove Nokia context prompt too
+ output_list = output.rstrip().splitlines()
+ last_line = output_list[-1]
+ other_lines = output_list[:-1]
+ last_line = nokia_context_filter(last_line)
+ output_list = other_lines + [last_line]
+ return "\n".join(output_list).rstrip()
else:
return output
@@ -894,7 +903,7 @@ Methods
-def enable (self, cmd='enable', pattern='ssword', enable_pattern=None, re_flags=)
+def enable (self, cmd='enable', pattern='ssword', enable_pattern=None, re_flags=re.IGNORECASE)
Enable SR OS administrative mode
@@ -1016,9 +1025,13 @@ Methods
"""Strip prompt from the output."""
output = super().strip_prompt(*args, **kwargs)
if "@" in self.base_prompt:
- # Remove context prompt too
- strips = r"[\r\n]*\!?\*?(\((ex|gl|pr|ro)\))?\[\S*\][\r\n]*"
- return re.sub(strips, "", output)
+ # Remove Nokia context prompt too
+ output_list = output.rstrip().splitlines()
+ last_line = output_list[-1]
+ other_lines = output_list[:-1]
+ last_line = nokia_context_filter(last_line)
+ output_list = other_lines + [last_line]
+ return "\n".join(output_list).rstrip()
else:
return output
diff --git a/docs/netmiko/ruckus/ruckus_fastiron.html b/docs/netmiko/ruckus/ruckus_fastiron.html
index 12ac11086..023186b1a 100644
--- a/docs/netmiko/ruckus/ruckus_fastiron.html
+++ b/docs/netmiko/ruckus/ruckus_fastiron.html
@@ -340,7 +340,7 @@ Subclasses
Methods
-def enable (self, cmd='enable', pattern='(ssword|User Name)', enable_pattern=None, re_flags=)
+def enable (self, cmd='enable', pattern='(ssword|User Name)', enable_pattern=None, re_flags=re.IGNORECASE)
Enter enable mode.
diff --git a/docs/netmiko/ssh_autodetect.html b/docs/netmiko/ssh_autodetect.html
index 98438505d..6b9969ef3 100644
--- a/docs/netmiko/ssh_autodetect.html
+++ b/docs/netmiko/ssh_autodetect.html
@@ -297,7 +297,7 @@
Netmiko connection creation section
},
"fortinet": {
"cmd": "get system status",
- "search_patterns": [r"FortiOS"],
+ "search_patterns": [r"FortiOS", r"FortiGate"],
"priority": 99,
"dispatch": "_autodetect_std",
},
diff --git a/docs/netmiko/tplink/tplink_jetstream.html b/docs/netmiko/tplink/tplink_jetstream.html
index 18e35708c..f571e7c33 100644
--- a/docs/netmiko/tplink/tplink_jetstream.html
+++ b/docs/netmiko/tplink/tplink_jetstream.html
@@ -492,7 +492,7 @@ Methods
-def enable (self, cmd='', pattern='ssword', enable_pattern=None, re_flags=)
+def enable (self, cmd='', pattern='ssword', enable_pattern=None, re_flags=re.IGNORECASE)
TPLink JetStream requires you to first execute "enable" and then execute "enable-admin".
diff --git a/docs/netmiko/ubiquiti/edge_ssh.html b/docs/netmiko/ubiquiti/edge_ssh.html
index 8383cee0a..cfc876d11 100644
--- a/docs/netmiko/ubiquiti/edge_ssh.html
+++ b/docs/netmiko/ubiquiti/edge_ssh.html
@@ -70,13 +70,41 @@
Module netmiko.ubiquiti.edge_ssh
def save_config(
self,
cmd: str = "write memory",
- confirm: bool = False,
- confirm_response: str = "",
+ confirm: bool = True,
+ confirm_response: str = "y",
) -> str:
- """Saves configuration."""
- return super().save_config(
- cmd=cmd, confirm=confirm, confirm_response=confirm_response
- )
+ """
+ EdgeSwitch might do the following:
+
+ Are you sure you want to save? (y/n) y
+
+ It is not clear to me that it always does this (or sometimes doesn't).
+
+ Consequently, save_config() handles both cases.
+ """
+ self.enable()
+ confirm_msg = "Are you sure"
+ pattern = rf"({confirm_msg}|\#)"
+ if confirm:
+ output = self._send_command_str(
+ command_string=cmd,
+ expect_string=pattern,
+ strip_prompt=False,
+ strip_command=False,
+ )
+ if confirm_response and confirm_msg in output:
+ output += self._send_command_str(
+ confirm_response,
+ expect_string=r"\#",
+ strip_prompt=False,
+ strip_command=False,
+ )
+ else:
+ # Shouldn't really be here--but handle base case if someone disables "confirm".
+ output = self._send_command_str(
+ command_string=cmd, strip_prompt=False, strip_command=False
+ )
+ return output
@@ -245,13 +273,41 @@
def save_config(
self,
cmd: str = "write memory",
- confirm: bool = False,
- confirm_response: str = "",
+ confirm: bool = True,
+ confirm_response: str = "y",
) -> str:
- """Saves configuration."""
- return super().save_config(
- cmd=cmd, confirm=confirm, confirm_response=confirm_response
- )
+ """
+ EdgeSwitch might do the following:
+
+ Are you sure you want to save? (y/n) y
+
+ It is not clear to me that it always does this (or sometimes doesn't).
+
+ Consequently, save_config() handles both cases.
+ """
+ self.enable()
+ confirm_msg = "Are you sure"
+ pattern = rf"({confirm_msg}|\#)"
+ if confirm:
+ output = self._send_command_str(
+ command_string=cmd,
+ expect_string=pattern,
+ strip_prompt=False,
+ strip_command=False,
+ )
+ if confirm_response and confirm_msg in output:
+ output += self._send_command_str(
+ confirm_response,
+ expect_string=r"\#",
+ strip_prompt=False,
+ strip_command=False,
+ )
+ else:
+ # Shouldn't really be here--but handle base case if someone disables "confirm".
+ output = self._send_command_str(
+ command_string=cmd, strip_prompt=False, strip_command=False
+ )
+ return output
Ancestors
@@ -318,22 +374,53 @@ Methods
-def save_config (self, cmd='write memory', confirm=False, confirm_response='')
+def save_config (self, cmd='write memory', confirm=True, confirm_response='y')
-
+EdgeSwitch might do the following:
+Are you sure you want to save? (y/n) y
+It is not clear to me that it always does this (or sometimes doesn't).
+Consequently, save_config() handles both cases.
Source code
def save_config(
self,
cmd: str = "write memory",
- confirm: bool = False,
- confirm_response: str = "",
+ confirm: bool = True,
+ confirm_response: str = "y",
) -> str:
- """Saves configuration."""
- return super().save_config(
- cmd=cmd, confirm=confirm, confirm_response=confirm_response
- )
+ """
+ EdgeSwitch might do the following:
+
+ Are you sure you want to save? (y/n) y
+
+ It is not clear to me that it always does this (or sometimes doesn't).
+
+ Consequently, save_config() handles both cases.
+ """
+ self.enable()
+ confirm_msg = "Are you sure"
+ pattern = rf"({confirm_msg}|\#)"
+ if confirm:
+ output = self._send_command_str(
+ command_string=cmd,
+ expect_string=pattern,
+ strip_prompt=False,
+ strip_command=False,
+ )
+ if confirm_response and confirm_msg in output:
+ output += self._send_command_str(
+ confirm_response,
+ expect_string=r"\#",
+ strip_prompt=False,
+ strip_command=False,
+ )
+ else:
+ # Shouldn't really be here--but handle base case if someone disables "confirm".
+ output = self._send_command_str(
+ command_string=cmd, strip_prompt=False, strip_command=False
+ )
+ return output
diff --git a/docs/netmiko/ubiquiti/edgerouter_ssh.html b/docs/netmiko/ubiquiti/edgerouter_ssh.html
index 810feb636..ddb2238a8 100644
--- a/docs/netmiko/ubiquiti/edgerouter_ssh.html
+++ b/docs/netmiko/ubiquiti/edgerouter_ssh.html
@@ -203,28 +203,6 @@ Ancestors
CiscoBaseConnection
BaseConnection
-Methods
-
-
-
-
-
-Source code
-def save_config(
- self, cmd: str = "save", confirm: bool = False, confirm_response: str = ""
-) -> str:
- """Saves Config."""
- if confirm is True:
- raise ValueError("EdgeRouter does not support save_config confirmation.")
- output = self._send_command_str(command_string=cmd)
- if "Done" not in output:
- raise ValueError(f"Save failed with following errors:\n\n{output}")
- return output
-
-
-
Inherited members
diff --git a/docs/netmiko/ubiquiti/index.html b/docs/netmiko/ubiquiti/index.html
index 17a814f28..c5cb7867c 100644
--- a/docs/netmiko/ubiquiti/index.html
+++ b/docs/netmiko/ubiquiti/index.html
@@ -200,28 +200,6 @@ Ancestors
CiscoBaseConnection
BaseConnection
-Methods
-
-
-
-
-
-Source code
-def save_config(
- self, cmd: str = "save", confirm: bool = False, confirm_response: str = ""
-) -> str:
- """Saves Config."""
- if confirm is True:
- raise ValueError("EdgeRouter does not support save_config confirmation.")
- output = self._send_command_str(command_string=cmd)
- if "Done" not in output:
- raise ValueError(f"Save failed with following errors:\n\n{output}")
- return output
-
-
-
Inherited members
VyOSSSH
:
@@ -249,6 +227,7 @@ Inherited members
read_until_prompt
read_until_prompt_or_pattern
run_ttp
+save_config
select_delay_factor
send_command
send_command_expect
@@ -427,13 +406,41 @@ Inherited members
def save_config(
self,
cmd: str = "write memory",
- confirm: bool = False,
- confirm_response: str = "",
+ confirm: bool = True,
+ confirm_response: str = "y",
) -> str:
- """Saves configuration."""
- return super().save_config(
- cmd=cmd, confirm=confirm, confirm_response=confirm_response
- )
+ """
+ EdgeSwitch might do the following:
+
+ Are you sure you want to save? (y/n) y
+
+ It is not clear to me that it always does this (or sometimes doesn't).
+
+ Consequently, save_config() handles both cases.
+ """
+ self.enable()
+ confirm_msg = "Are you sure"
+ pattern = rf"({confirm_msg}|\#)"
+ if confirm:
+ output = self._send_command_str(
+ command_string=cmd,
+ expect_string=pattern,
+ strip_prompt=False,
+ strip_command=False,
+ )
+ if confirm_response and confirm_msg in output:
+ output += self._send_command_str(
+ confirm_response,
+ expect_string=r"\#",
+ strip_prompt=False,
+ strip_command=False,
+ )
+ else:
+ # Shouldn't really be here--but handle base case if someone disables "confirm".
+ output = self._send_command_str(
+ command_string=cmd, strip_prompt=False, strip_command=False
+ )
+ return output
Ancestors
@@ -500,22 +507,53 @@ Methods
-def save_config (self, cmd='write memory', confirm=False, confirm_response='')
+def save_config (self, cmd='write memory', confirm=True, confirm_response='y')
-
+EdgeSwitch might do the following:
+Are you sure you want to save? (y/n) y
+It is not clear to me that it always does this (or sometimes doesn't).
+Consequently, save_config() handles both cases.
Source code
def save_config(
self,
cmd: str = "write memory",
- confirm: bool = False,
- confirm_response: str = "",
+ confirm: bool = True,
+ confirm_response: str = "y",
) -> str:
- """Saves configuration."""
- return super().save_config(
- cmd=cmd, confirm=confirm, confirm_response=confirm_response
- )
+ """
+ EdgeSwitch might do the following:
+
+ Are you sure you want to save? (y/n) y
+
+ It is not clear to me that it always does this (or sometimes doesn't).
+
+ Consequently, save_config() handles both cases.
+ """
+ self.enable()
+ confirm_msg = "Are you sure"
+ pattern = rf"({confirm_msg}|\#)"
+ if confirm:
+ output = self._send_command_str(
+ command_string=cmd,
+ expect_string=pattern,
+ strip_prompt=False,
+ strip_command=False,
+ )
+ if confirm_response and confirm_msg in output:
+ output += self._send_command_str(
+ confirm_response,
+ expect_string=r"\#",
+ strip_prompt=False,
+ strip_command=False,
+ )
+ else:
+ # Shouldn't really be here--but handle base case if someone disables "confirm".
+ output = self._send_command_str(
+ command_string=cmd, strip_prompt=False, strip_command=False
+ )
+ return output
@@ -830,9 +868,6 @@ Index
-
diff --git a/docs/netmiko/utilities.html b/docs/netmiko/utilities.html
index e70f045b6..0b1e54edc 100644
--- a/docs/netmiko/utilities.html
+++ b/docs/netmiko/utilities.html
@@ -37,6 +37,7 @@ Module netmiko.utilities
Tuple,
)
from typing import TYPE_CHECKING
+import re
from glob import glob
import sys
import io
@@ -44,6 +45,7 @@ Module netmiko.utilities
from pathlib import Path
import functools
from datetime import datetime
+import importlib.resources as pkg_resources
from textfsm import clitable
from textfsm.clitable import CliTableError
from netmiko import log
@@ -73,12 +75,6 @@ Module netmiko.utilities
except ImportError:
GENIE_INSTALLED = False
-# If we are on python < 3.7, we need to force the import of importlib.resources backport
-if sys.version_info[:2] >= (3, 7):
- import importlib.resources as pkg_resources
-else:
- import importlib_resources as pkg_resources
-
try:
import serial.tools.list_ports
@@ -327,7 +323,7 @@ Module netmiko.utilities
else:
# Try 'pip installed' ntc-templates
try:
- with pkg_resources.path(
+ with pkg_resources.path( # type: ignore
package="ntc_templates", resource="parse.py"
) as posix_path:
# Example: /opt/venv/netmiko/lib/python3.8/site-packages/ntc_templates/templates
@@ -679,7 +675,21 @@ Module netmiko.utilities
if delay_factor == 1 and max_loops == 500:
max_loops = int(old_timeout / loop_delay)
- return max_loops * loop_delay * delay_factor
+ return max_loops * loop_delay * delay_factor
+
+
+def nokia_context_filter(data: str, re_flags: int = re.M) -> str:
+ """
+ Nokia context from string. Examples:
+
+ (ro)[]
+
+ (ex)[configure router "Base" bgp]
+
+ Converted over to a standalone function for easier unit testing.
+ """
+ context_pattern = r"^\!?\*?(\((ex|gl|pr|ro)\))?\[.*\]"
+ return re.sub(context_pattern, "", data, flags=re_flags)
@@ -1152,7 +1162,7 @@
else:
# Try 'pip installed' ntc-templates
try:
- with pkg_resources.path(
+ with pkg_resources.path( # type: ignore
package="ntc_templates", resource="parse.py"
) as posix_path:
# Example: /opt/venv/netmiko/lib/python3.8/site-packages/ntc_templates/templates
@@ -1227,6 +1237,30 @@
return cast(F, wrapper_decorator)
+
+def nokia_context_filter (data, re_flags=re.MULTILINE)
+
+
+Nokia context from string. Examples:
+(ro)[]
+(ex)[configure router "Base" bgp]
+Converted over to a standalone function for easier unit testing.
+
+Source code
+def nokia_context_filter(data: str, re_flags: int = re.M) -> str:
+ """
+ Nokia context from string. Examples:
+
+ (ro)[]
+
+ (ex)[configure router "Base" bgp]
+
+ Converted over to a standalone function for easier unit testing.
+ """
+ context_pattern = r"^\!?\*?(\((ex|gl|pr|ro)\))?\[.*\]"
+ return re.sub(context_pattern, "", data, flags=re_flags)
+
+
def obtain_all_devices (my_devices)
@@ -1480,6 +1514,7 @@ Index
load_devices
load_yaml_file
m_exec_time
+nokia_context_filter
obtain_all_devices
obtain_netmiko_filename
run_ttp_template
diff --git a/docs/netmiko/vyos/index.html b/docs/netmiko/vyos/index.html
index c8acadf6d..1512bfa58 100644
--- a/docs/netmiko/vyos/index.html
+++ b/docs/netmiko/vyos/index.html
@@ -278,13 +278,15 @@
)
def save_config(
- self,
- cmd: str = "copy running-config startup-config",
- confirm: bool = False,
- confirm_response: str = "",
+ self, cmd: str = "save", confirm: bool = False, confirm_response: str = ""
) -> str:
- """Not Implemented"""
- raise NotImplementedError
+ """Saves Config."""
+ output = super().save_config(
+ cmd=cmd, confirm=confirm, confirm_response=confirm_response
+ )
+ if "Done" not in output:
+ raise ValueError(f"Save failed with following errors:\n\n{output}")
+ return output
Ancestors
@@ -393,23 +395,6 @@ Methods
return output
-
-def save_config (self, cmd='copy running-config startup-config', confirm=False, confirm_response='')
-
-
-
-
-Source code
-def save_config(
- self,
- cmd: str = "copy running-config startup-config",
- confirm: bool = False,
- confirm_response: str = "",
-) -> str:
- """Not Implemented"""
- raise NotImplementedError
-
-
def send_config_set (self, config_commands=None, exit_config_mode=False, **kwargs)
@@ -506,6 +491,7 @@ Inherited members
read_until_prompt
read_until_prompt_or_pattern
run_ttp
+save_config
select_delay_factor
send_command
send_command_expect
@@ -551,7 +537,6 @@
@@ -408,13 +410,15 @@
)
def save_config(
- self,
- cmd: str = "copy running-config startup-config",
- confirm: bool = False,
- confirm_response: str = "",
+ self, cmd: str = "save", confirm: bool = False, confirm_response: str = ""
) -> str:
- """Not Implemented"""
- raise NotImplementedError
+ """Saves Config."""
+ output = super().save_config(
+ cmd=cmd, confirm=confirm, confirm_response=confirm_response
+ )
+ if "Done" not in output:
+ raise ValueError(f"Save failed with following errors:\n\n{output}")
+ return output
Ancestors
@@ -523,23 +527,6 @@ Methods
return output
-
-def save_config (self, cmd='copy running-config startup-config', confirm=False, confirm_response='')
-
-
-
-
-Source code
-def save_config(
- self,
- cmd: str = "copy running-config startup-config",
- confirm: bool = False,
- confirm_response: str = "",
-) -> str:
- """Not Implemented"""
- raise NotImplementedError
-
-
def send_config_set (self, config_commands=None, exit_config_mode=False, **kwargs)
@@ -636,6 +623,7 @@ Inherited members
read_until_prompt
read_until_prompt_or_pattern
run_ttp
+save_config
select_delay_factor
send_command
send_command_expect
@@ -676,7 +664,6 @@ check_config_mode
commit
exit_config_mode
-save_config
send_config_set
session_preparation
set_base_prompt
diff --git a/release_process.txt b/release_process.txt
index 4f5f78668..23444ffc9 100644
--- a/release_process.txt
+++ b/release_process.txt
@@ -1,6 +1,6 @@
# Use pydev1 machine
-# Use virtual environment = py3_netmiko
+# Use virtual environment = .venv
# Run the following command to update docs:
$ pdoc3 --html --output-dir docs netmiko --force
From 54aa68ed95293b6a8af188bf4202a96a767d019c Mon Sep 17 00:00:00 2001
From: Kirk Byers
Date: Wed, 27 Apr 2022 11:33:55 -0700
Subject: [PATCH 29/29] Roll version to 4.1.0 (#2765)
---
netmiko/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/netmiko/__init__.py b/netmiko/__init__.py
index fb0f3a505..9e68d2070 100644
--- a/netmiko/__init__.py
+++ b/netmiko/__init__.py
@@ -31,7 +31,7 @@
# Alternate naming
Netmiko = ConnectHandler
-__version__ = "4.0.1a1"
+__version__ = "4.1.0"
__all__ = (
"ConnectHandler",
"ConnLogOnly",