Skip to content

Commit

Permalink
Merge pull request #974 from ktbyers/develop
Browse files Browse the repository at this point in the history
Netmiko Release 2.3.0
  • Loading branch information
ktbyers authored Oct 10, 2018
2 parents 0e27ae0 + cd904bb commit e6716be
Show file tree
Hide file tree
Showing 46 changed files with 819 additions and 246 deletions.
141 changes: 78 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![PyPI](https://img.shields.io/pypi/v/netmiko.svg)](https://pypi.python.org/pypi/netmiko)


Netmiko
=======

Expand All @@ -10,70 +10,75 @@ Python 2.7, 3.5, 3.6

#### Requires:

Paramiko >= 2
scp >= 0.10.0
pyyaml
pyserial
textfsm
- Paramiko >= 2.4.1
- scp >= 0.10.0
- pyyaml
- pyserial
- textfsm

#### Supports:

###### Regularly tested

Arista vEOS
Cisco ASA
Cisco IOS
Cisco IOS-XE
Cisco IOS-XR
Cisco NX-OS
Cisco SG300
HP Comware7
HP ProCurve
Juniper Junos
Linux
- Arista vEOS
- Cisco ASA
- Cisco IOS
- Cisco IOS-XE
- Cisco IOS-XR
- Cisco NX-OS
- Cisco SG300
- HP Comware7
- HP ProCurve
- Juniper Junos
- Linux

###### Limited testing

Alcatel AOS6/AOS8
Apresia Systems AEOS
Avaya ERS
Avaya VSP
Brocade VDX
Brocade MLX/NetIron
Calix B6
Cisco WLC
Dell OS10
Dell-Force10
Dell PowerConnect
Huawei
Mellanox
NetApp cDOT
Palo Alto PAN-OS
Pluribus
Ruckus ICX/FastIron
Ubiquiti EdgeSwitch
Vyatta VyOS
- Alcatel AOS6/AOS8
- Apresia Systems AEOS
- Calix B6
- Cisco WLC
- Dell OS9 (Force10)
- Dell OS10
- Dell PowerConnect
- Extreme ERS (Avaya)
- Extreme VSP (Avaya)
- Extreme VDX (Brocade)
- Extreme MLX/NetIron (Brocade/Foundry)
- Huawei
- IP Infusion OcNOS
- Mellanox
- NetApp cDOT
- Palo Alto PAN-OS
- Pluribus
- Ruckus ICX/FastIron
- Ubiquiti EdgeSwitch
- Vyatta VyOS

###### Experimental

A10
Accedian
Aruba
Ciena SAOS
Citrix Netscaler
Cisco Telepresence
Check Point GAiA
Coriant
Dell EMC Isilon
Eltex
Enterasys
Extreme EXOS
Extreme Wing
F5 LTM
Fortinet
MRV Communications OptiSwitch
Nokia/Alcatel SR-OS
QuantaMesh
- A10
- Accedian
- Aruba
- Ciena SAOS
- Citrix Netscaler
- Cisco Telepresence
- Check Point GAiA
- Coriant
- Dell OS6
- Dell EMC Isilon
- Eltex
- Enterasys
- Extreme EXOS
- Extreme Wing
- Extreme SLX (Brocade)
- F5 TMSH
- F5 Linux
- Fortinet
- MRV Communications OptiSwitch
- Nokia/Alcatel SR-OS
- QuantaMesh
- Rad ETX

## Tutorials:

Expand Down Expand Up @@ -131,12 +136,12 @@ print(output)
```
```
Interface IP-Address OK? Method Status Protocol
FastEthernet0 unassigned YES unset down down
FastEthernet1 unassigned YES unset down down
FastEthernet2 unassigned YES unset down down
FastEthernet3 unassigned YES unset down down
FastEthernet4 10.10.10.10 YES manual up up
Vlan1 unassigned YES unset down down
FastEthernet0 unassigned YES unset down down
FastEthernet1 unassigned YES unset down down
FastEthernet2 unassigned YES unset down down
FastEthernet3 unassigned YES unset down down
FastEthernet4 10.10.10.10 YES manual up up
Vlan1 unassigned YES unset down down
```

#### Execute configuration change commands (will automatically enter into config mode)
Expand All @@ -158,6 +163,16 @@ pynet-rtr1(config)#end
pynet-rtr1#
```

## TextFSM Integration

Netmiko has been configured to automatically look in `~/ntc-template/templates/index` for the ntc-templates index file. Alternatively, you can explicitly tell Netmiko where to look for the TextFSM template directory by setting the `NET_TEXTFSM` environment variable (note, there must be an index file in this directory):

```
export NET_TEXTFSM=/path/to/ntc-templates/templates/
```

[More info on TextFSM and Netmiko](https://pynet.twb-tech.com/blog/automation/netmiko-textfsm.html).

## Questions/Discussion

If you find an issue with Netmiko, then you can open an issue on this projects issue page here: [https://github.com/ktbyers/netmiko/issues](https://github.com/ktbyers/netmiko/issues)
Expand All @@ -167,7 +182,7 @@ If you have questions or would like to discuss Netmiko, a Netmiko channel exists



---
---
Kirk Byers
Python for Network Engineers
https://pynet.twb-tech.com
2 changes: 1 addition & 1 deletion docs/build/html/classes/base_connection.html
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ <h1>BaseConnection<a class="headerlink" href="#baseconnection" title="Permalink
ESC[E Next line (HP does ESC-E)
ESC[2K Erase line
ESC[1;24r Enable scrolling from start to row end</p>
<p>HP ProCurve&#8217;s, Cisco SG300, and F5 LTM&#8217;s require this (possible others)</p>
<p>HP ProCurve&#8217;s, Cisco SG300, and F5 Big-IP&#8217;s require this (possible others)</p>
</dd></dl>

<dl class="staticmethod">
Expand Down
2 changes: 1 addition & 1 deletion netmiko/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
NetmikoAuthError = NetMikoAuthenticationException
Netmiko = ConnectHandler

__version__ = '2.2.2'
__version__ = '2.3.0'
__all__ = ('ConnectHandler', 'ssh_dispatcher', 'platforms', 'SCPConn', 'FileTransfer',
'NetMikoTimeoutException', 'NetMikoAuthenticationException',
'NetmikoTimeoutError', 'NetmikoAuthError', 'InLineTransfer', 'redispatch',
Expand Down
28 changes: 27 additions & 1 deletion netmiko/alcatel/alcatel_sros_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,33 @@ def set_base_prompt(self, *args, **kwargs):
self.base_prompt = match.group(1)
return self.base_prompt

def enable(self, *args, **kwargs):
def enable(self, cmd='enable-admin', pattern='ssword', re_flags=re.IGNORECASE):
"""Enter enable mode."""
return super(AlcatelSrosSSH, self).enable(cmd=cmd, pattern=pattern, re_flags=re_flags)

def check_enable_mode(self, check_string='CLI Already in admin mode'):
"""Check whether we are in enable-admin mode.
SROS requires us to do this:
*A:HOSTNAME# enable-admin
MINOR: CLI Already in admin mode.
*A:HOSTNAME#
*A:HOSTNAME# enable-admin
Password:
MINOR: CLI Invalid password.
*A:HOSTNAME#
"""
output = self.send_command_timing('enable-admin')
if re.search(r"ssword", output):
# Just hit enter as we don't actually want to enter enable here
self.write_channel(self.normalize_cmd(self.RETURN))
self.read_until_prompt()
return False
elif check_string in output:
return True
raise ValueError("Unexpected response in check_enable_mode() method")

def exit_enable_mode(self, exit_command=''):
"""No corresponding exit of enable mode on SROS."""
pass

def config_mode(self, config_command='configure', pattern='#'):
Expand Down
2 changes: 1 addition & 1 deletion netmiko/apresia/apresia_aeos.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def disable_paging(self, command="", delay_factor=1):
check_command = "show running-config | include terminal length 0"
output = self.send_command(check_command)

if "terminal length 0" not in output:
if self.allow_auto_change and "terminal length 0" not in output:
self.send_config_set("terminal length 0")
self.exit_enable_mode()

Expand Down
5 changes: 5 additions & 0 deletions netmiko/aruba/aruba_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

class ArubaSSH(CiscoSSHConnection):
"""Aruba OS support"""
def __init__(self, **kwargs):
if kwargs.get('default_enter') is None:
kwargs['default_enter'] = '\r'
return super(ArubaSSH, self).__init__(**kwargs)

def session_preparation(self):
"""Aruba OS requires enable mode to disable paging."""
delay_factor = self.select_delay_factor(delay_factor=0)
Expand Down
5 changes: 0 additions & 5 deletions netmiko/avaya/__init__.py

This file was deleted.

Loading

0 comments on commit e6716be

Please sign in to comment.