Skip to content

Commit

Permalink
Merge pull request #2766 from ktbyers/develop
Browse files Browse the repository at this point in the history
Netmiko Release 4.1.0
  • Loading branch information
ktbyers authored Apr 27, 2022
2 parents ddc78b3 + 54aa68e commit 5bbbb73
Show file tree
Hide file tree
Showing 82 changed files with 1,393 additions and 697 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
---
name: build
on: [push, pull_request]
env:
environment: gh_actions
jobs:
std_tests:
runs-on: ubuntu-latest
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
Expand Down
6 changes: 3 additions & 3 deletions docs/netmiko/aruba/aruba_ssh.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h1 class="title">Module <code>netmiko.aruba.aruba_ssh</code></h1>
self._test_channel_read(pattern=r&#34;[&gt;#]&#34;)
self.set_base_prompt()
self.enable()
self.disable_paging(command=&#34;no page&#34;)
self.disable_paging(command=&#34;no paging&#34;)

def check_config_mode(
self, check_string: str = &#34;(config) #&#34;, pattern: str = r&#34;[&gt;#]&#34;
Expand Down Expand Up @@ -214,7 +214,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
self._test_channel_read(pattern=r&#34;[&gt;#]&#34;)
self.set_base_prompt()
self.enable()
self.disable_paging(command=&#34;no page&#34;)
self.disable_paging(command=&#34;no paging&#34;)

def check_config_mode(
self, check_string: str = &#34;(config) #&#34;, pattern: str = r&#34;[&gt;#]&#34;
Expand Down Expand Up @@ -297,7 +297,7 @@ <h3>Methods</h3>
self._test_channel_read(pattern=r&#34;[&gt;#]&#34;)
self.set_base_prompt()
self.enable()
self.disable_paging(command=&#34;no page&#34;)</code></pre>
self.disable_paging(command=&#34;no paging&#34;)</code></pre>
</details>
</dd>
</dl>
Expand Down
4 changes: 2 additions & 2 deletions docs/netmiko/aruba/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
self._test_channel_read(pattern=r&#34;[&gt;#]&#34;)
self.set_base_prompt()
self.enable()
self.disable_paging(command=&#34;no page&#34;)
self.disable_paging(command=&#34;no paging&#34;)

def check_config_mode(
self, check_string: str = &#34;(config) #&#34;, pattern: str = r&#34;[&gt;#]&#34;
Expand Down Expand Up @@ -255,7 +255,7 @@ <h3>Methods</h3>
self._test_channel_read(pattern=r&#34;[&gt;#]&#34;)
self.set_base_prompt()
self.enable()
self.disable_paging(command=&#34;no page&#34;)</code></pre>
self.disable_paging(command=&#34;no paging&#34;)</code></pre>
</details>
</dd>
</dl>
Expand Down
18 changes: 9 additions & 9 deletions docs/netmiko/base_connection.html
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ <h1 class="title">Module <code>netmiko.base_connection</code></h1>
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&#34;({pattern})&#34;
Expand Down Expand Up @@ -1150,7 +1150,7 @@ <h1 class="title">Module <code>netmiko.base_connection</code></h1>
time.sleep(main_delay * 10)
new_data = &#34;&#34;
while i &lt;= count:
new_data += self.read_channel_timing()
new_data += self.read_channel_timing(read_timeout=20)
if new_data:
return new_data

Expand Down Expand Up @@ -1971,7 +1971,7 @@ <h1 class="title">Module <code>netmiko.base_connection</code></h1>
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
Expand Down Expand Up @@ -3068,7 +3068,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
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&#34;({pattern})&#34;
Expand Down Expand Up @@ -3575,7 +3575,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
time.sleep(main_delay * 10)
new_data = &#34;&#34;
while i &lt;= count:
new_data += self.read_channel_timing()
new_data += self.read_channel_timing(read_timeout=20)
if new_data:
return new_data

Expand Down Expand Up @@ -4396,7 +4396,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
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
Expand Down Expand Up @@ -4892,7 +4892,7 @@ <h3>Methods</h3>
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</code></pre>
Expand Down Expand Up @@ -5120,7 +5120,7 @@ <h3>Methods</h3>
</details>
</dd>
<dt id="netmiko.base_connection.BaseConnection.enable"><code class="name flex">
<span>def <span class="ident">enable</span></span>(<span>self, cmd='', pattern='ssword', enable_pattern=None, re_flags=<RegexFlag.IGNORECASE: 2>)</span>
<span>def <span class="ident">enable</span></span>(<span>self, cmd='', pattern='ssword', enable_pattern=None, re_flags=re.IGNORECASE)</span>
</code></dt>
<dd>
<section class="desc"><p>Enter enable mode.</p>
Expand Down Expand Up @@ -5711,7 +5711,7 @@ <h3>Methods</h3>
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&#34;({pattern})&#34;
Expand Down
88 changes: 82 additions & 6 deletions docs/netmiko/cisco/cisco_ios.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,30 @@ <h1 class="title">Module <code>netmiko.cisco.cisco_ios</code></h1>
self.disable_paging()
self.set_base_prompt()

def check_config_mode(self, check_string: str = &#34;)#&#34;, pattern: str = r&#34;#&#34;) -&gt; bool:
def set_base_prompt(
self,
pri_prompt_terminator: str = &#34;#&#34;,
alt_prompt_terminator: str = &#34;&gt;&#34;,
delay_factor: float = 1.0,
pattern: Optional[str] = None,
) -&gt; str:
&#34;&#34;&#34;
Cisco IOS/IOS-XE abbreviates the prompt at 20-chars in config mode.

Consequently, abbreviate the base_prompt
&#34;&#34;&#34;
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 = &#34;)#&#34;, pattern: str = r&#34;[&gt;#]&#34;
) -&gt; bool:
&#34;&#34;&#34;
Checks if the device is in configuration mode or not.

Expand Down Expand Up @@ -419,7 +442,30 @@ <h2 class="section-title" id="header-classes">Classes</h2>
self.disable_paging()
self.set_base_prompt()

def check_config_mode(self, check_string: str = &#34;)#&#34;, pattern: str = r&#34;#&#34;) -&gt; bool:
def set_base_prompt(
self,
pri_prompt_terminator: str = &#34;#&#34;,
alt_prompt_terminator: str = &#34;&gt;&#34;,
delay_factor: float = 1.0,
pattern: Optional[str] = None,
) -&gt; str:
&#34;&#34;&#34;
Cisco IOS/IOS-XE abbreviates the prompt at 20-chars in config mode.

Consequently, abbreviate the base_prompt
&#34;&#34;&#34;
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 = &#34;)#&#34;, pattern: str = r&#34;[&gt;#]&#34;
) -&gt; bool:
&#34;&#34;&#34;
Checks if the device is in configuration mode or not.

Expand Down Expand Up @@ -481,6 +527,36 @@ <h3>Methods</h3>
self.set_base_prompt()</code></pre>
</details>
</dd>
<dt id="netmiko.cisco.cisco_ios.CiscoIosBase.set_base_prompt"><code class="name flex">
<span>def <span class="ident">set_base_prompt</span></span>(<span>self, pri_prompt_terminator='#', alt_prompt_terminator='>', delay_factor=1.0, pattern=None)</span>
</code></dt>
<dd>
<section class="desc"><p>Cisco IOS/IOS-XE abbreviates the prompt at 20-chars in config mode.</p>
<p>Consequently, abbreviate the base_prompt</p></section>
<details class="source">
<summary>Source code</summary>
<pre><code class="python">def set_base_prompt(
self,
pri_prompt_terminator: str = &#34;#&#34;,
alt_prompt_terminator: str = &#34;&gt;&#34;,
delay_factor: float = 1.0,
pattern: Optional[str] = None,
) -&gt; str:
&#34;&#34;&#34;
Cisco IOS/IOS-XE abbreviates the prompt at 20-chars in config mode.

Consequently, abbreviate the base_prompt
&#34;&#34;&#34;
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</code></pre>
</details>
</dd>
</dl>
<h3>Inherited members</h3>
<ul class="hlist">
Expand Down Expand Up @@ -516,7 +592,6 @@ <h3>Inherited members</h3>
<li><code><a title="netmiko.cisco_base_connection.CiscoBaseConnection.send_config_from_file" href="../base_connection.html#netmiko.base_connection.BaseConnection.send_config_from_file">send_config_from_file</a></code></li>
<li><code><a title="netmiko.cisco_base_connection.CiscoBaseConnection.send_config_set" href="../base_connection.html#netmiko.base_connection.BaseConnection.send_config_set">send_config_set</a></code></li>
<li><code><a title="netmiko.cisco_base_connection.CiscoBaseConnection.send_multiline" href="../base_connection.html#netmiko.base_connection.BaseConnection.send_multiline">send_multiline</a></code></li>
<li><code><a title="netmiko.cisco_base_connection.CiscoBaseConnection.set_base_prompt" href="../base_connection.html#netmiko.base_connection.BaseConnection.set_base_prompt">set_base_prompt</a></code></li>
<li><code><a title="netmiko.cisco_base_connection.CiscoBaseConnection.set_terminal_width" href="../base_connection.html#netmiko.base_connection.BaseConnection.set_terminal_width">set_terminal_width</a></code></li>
<li><code><a title="netmiko.cisco_base_connection.CiscoBaseConnection.special_login_handler" href="../base_connection.html#netmiko.base_connection.BaseConnection.special_login_handler">special_login_handler</a></code></li>
<li><code><a title="netmiko.cisco_base_connection.CiscoBaseConnection.strip_ansi_escape_codes" href="../base_connection.html#netmiko.base_connection.BaseConnection.strip_ansi_escape_codes">strip_ansi_escape_codes</a></code></li>
Expand Down Expand Up @@ -734,7 +809,7 @@ <h3>Inherited members</h3>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.send_config_set" href="../base_connection.html#netmiko.base_connection.BaseConnection.send_config_set">send_config_set</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.send_multiline" href="../base_connection.html#netmiko.base_connection.BaseConnection.send_multiline">send_multiline</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.session_preparation" href="#netmiko.cisco.cisco_ios.CiscoIosBase.session_preparation">session_preparation</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.set_base_prompt" href="../base_connection.html#netmiko.base_connection.BaseConnection.set_base_prompt">set_base_prompt</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.set_base_prompt" href="#netmiko.cisco.cisco_ios.CiscoIosBase.set_base_prompt">set_base_prompt</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.set_terminal_width" href="../base_connection.html#netmiko.base_connection.BaseConnection.set_terminal_width">set_terminal_width</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.special_login_handler" href="../base_connection.html#netmiko.base_connection.BaseConnection.special_login_handler">special_login_handler</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.strip_ansi_escape_codes" href="../base_connection.html#netmiko.base_connection.BaseConnection.strip_ansi_escape_codes">strip_ansi_escape_codes</a></code></li>
Expand Down Expand Up @@ -905,7 +980,7 @@ <h3>Inherited members</h3>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.send_config_set" href="../base_connection.html#netmiko.base_connection.BaseConnection.send_config_set">send_config_set</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.send_multiline" href="../base_connection.html#netmiko.base_connection.BaseConnection.send_multiline">send_multiline</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.session_preparation" href="#netmiko.cisco.cisco_ios.CiscoIosBase.session_preparation">session_preparation</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.set_base_prompt" href="../base_connection.html#netmiko.base_connection.BaseConnection.set_base_prompt">set_base_prompt</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.set_base_prompt" href="#netmiko.cisco.cisco_ios.CiscoIosBase.set_base_prompt">set_base_prompt</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.set_terminal_width" href="../base_connection.html#netmiko.base_connection.BaseConnection.set_terminal_width">set_terminal_width</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.special_login_handler" href="../base_connection.html#netmiko.base_connection.BaseConnection.special_login_handler">special_login_handler</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.strip_ansi_escape_codes" href="../base_connection.html#netmiko.base_connection.BaseConnection.strip_ansi_escape_codes">strip_ansi_escape_codes</a></code></li>
Expand Down Expand Up @@ -1076,7 +1151,7 @@ <h3>Inherited members</h3>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.send_config_set" href="../base_connection.html#netmiko.base_connection.BaseConnection.send_config_set">send_config_set</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.send_multiline" href="../base_connection.html#netmiko.base_connection.BaseConnection.send_multiline">send_multiline</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.session_preparation" href="#netmiko.cisco.cisco_ios.CiscoIosBase.session_preparation">session_preparation</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.set_base_prompt" href="../base_connection.html#netmiko.base_connection.BaseConnection.set_base_prompt">set_base_prompt</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.set_base_prompt" href="#netmiko.cisco.cisco_ios.CiscoIosBase.set_base_prompt">set_base_prompt</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.set_terminal_width" href="../base_connection.html#netmiko.base_connection.BaseConnection.set_terminal_width">set_terminal_width</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.special_login_handler" href="../base_connection.html#netmiko.base_connection.BaseConnection.special_login_handler">special_login_handler</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.strip_ansi_escape_codes" href="../base_connection.html#netmiko.base_connection.BaseConnection.strip_ansi_escape_codes">strip_ansi_escape_codes</a></code></li>
Expand Down Expand Up @@ -1387,6 +1462,7 @@ <h4><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase" href="#netmiko.cisco.c
<ul class="">
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.save_config" href="#netmiko.cisco.cisco_ios.CiscoIosBase.save_config">save_config</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.session_preparation" href="#netmiko.cisco.cisco_ios.CiscoIosBase.session_preparation">session_preparation</a></code></li>
<li><code><a title="netmiko.cisco.cisco_ios.CiscoIosBase.set_base_prompt" href="#netmiko.cisco.cisco_ios.CiscoIosBase.set_base_prompt">set_base_prompt</a></code></li>
</ul>
</li>
<li>
Expand Down
14 changes: 10 additions & 4 deletions docs/netmiko/cisco/cisco_nxos_ssh.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ <h1 class="title">Module <code>netmiko.cisco.cisco_nxos_ssh</code></h1>
# NX-OS fix for incorrect MD5 on 9K (due to strange &lt;enter&gt; patterns on NX-OS)
return newline.sub(self.RESPONSE_RETURN, a_string).replace(&#34;\r&#34;, &#34;\n&#34;)

def check_config_mode(self, check_string: str = &#34;)#&#34;, pattern: str = &#34;#&#34;) -&gt; bool:
def check_config_mode(
self, check_string: str = &#34;)#&#34;, pattern: str = r&#34;[&gt;#]&#34;
) -&gt; bool:
&#34;&#34;&#34;Checks if the device is in configuration mode or not.&#34;&#34;&#34;
return super().check_config_mode(check_string=check_string, pattern=pattern)

Expand Down Expand Up @@ -501,7 +503,9 @@ <h3>Inherited members</h3>
# NX-OS fix for incorrect MD5 on 9K (due to strange &lt;enter&gt; patterns on NX-OS)
return newline.sub(self.RESPONSE_RETURN, a_string).replace(&#34;\r&#34;, &#34;\n&#34;)

def check_config_mode(self, check_string: str = &#34;)#&#34;, pattern: str = &#34;#&#34;) -&gt; bool:
def check_config_mode(
self, check_string: str = &#34;)#&#34;, pattern: str = r&#34;[&gt;#]&#34;
) -&gt; bool:
&#34;&#34;&#34;Checks if the device is in configuration mode or not.&#34;&#34;&#34;
return super().check_config_mode(check_string=check_string, pattern=pattern)

Expand Down Expand Up @@ -546,13 +550,15 @@ <h3>Ancestors</h3>
<h3>Methods</h3>
<dl>
<dt id="netmiko.cisco.cisco_nxos_ssh.CiscoNxosSSH.check_config_mode"><code class="name flex">
<span>def <span class="ident">check_config_mode</span></span>(<span>self, check_string=')#', pattern='#')</span>
<span>def <span class="ident">check_config_mode</span></span>(<span>self, check_string=')#', pattern='[>#]')</span>
</code></dt>
<dd>
<section class="desc"><p>Checks if the device is in configuration mode or not.</p></section>
<details class="source">
<summary>Source code</summary>
<pre><code class="python">def check_config_mode(self, check_string: str = &#34;)#&#34;, pattern: str = &#34;#&#34;) -&gt; bool:
<pre><code class="python">def check_config_mode(
self, check_string: str = &#34;)#&#34;, pattern: str = r&#34;[&gt;#]&#34;
) -&gt; bool:
&#34;&#34;&#34;Checks if the device is in configuration mode or not.&#34;&#34;&#34;
return super().check_config_mode(check_string=check_string, pattern=pattern)</code></pre>
</details>
Expand Down
Loading

0 comments on commit 5bbbb73

Please sign in to comment.