Skip to content

Commit

Permalink
Merge branch 'ktbyers:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastien-guay committed Jun 27, 2023
2 parents 4793ce5 + 5f9eaa9 commit 2b5dbf1
Show file tree
Hide file tree
Showing 251 changed files with 20,785 additions and 2,941 deletions.
108 changes: 80 additions & 28 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
@@ -1,49 +1,101 @@
---
name: build
on: [push, pull_request]
---
name: Netmiko
on: [push,pull_request]
env:
environment: gh_actions
FORCE_COLOR: 1

jobs:
std_tests:
runs-on: ubuntu-latest
linters:
name: linters
strategy:
max-parallel: 4
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10.9"]
python-version: [ '3.10' ]
platform: [ubuntu-20.04]

runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -r requirements-genie.txt
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
virtualenvs-create: true
virtualenvs-in-project: true

- name: Run black
- name: Cache Poetry virtualenv
uses: actions/cache@v2
id: cached-poetry-dependencies
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install Dependencies
run: poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'

- name: Run pylama
run: |
black --check .
poetry run pylama .
- name: Run linter
- name: Run black
run: |
pylama .
poetry run black --check .
- name: Run mypy
run: |
mypy ./netmiko/
poetry run mypy --version
poetry run mypy ./netmiko/
pytest:
name: Testing on Python ${{ matrix.python-version }} (${{ matrix.platform}})
defaults:
run:
shell: bash
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
platform: [ubuntu-20.04]

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
virtualenvs-create: true
virtualenvs-in-project: true

- name: Cache Poetry virtualenv
uses: actions/cache@v2
id: cached-poetry-dependencies
with:
path: .venv
key: venv-${{ matrix.python-version }}-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
if: ${{ matrix.platform != 'windows-latest' }} # windows hangs if using a cached venv

- name: Install Dependencies
run: poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'

- name: Run Tests
run: |
pytest -v -s tests/test_import_netmiko.py
pytest -v -s tests/unit/test_base_connection.py
pytest -v -s tests/unit/test_utilities.py
pytest -v -s tests/unit/test_ssh_autodetect.py
pytest -v -s tests/unit/test_connection.py
poetry run pytest -v -s tests/test_import_netmiko.py
poetry run pytest -v -s tests/unit/test_base_connection.py
poetry run pytest -v -s tests/unit/test_utilities.py
poetry run pytest -v -s tests/unit/test_ssh_autodetect.py
poetry run pytest -v -s tests/unit/test_connection.py
poetry run pytest -v -s tests/unit/test_entry_points.py
19 changes: 19 additions & 0 deletions COMMON_ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,22 @@ redispatch(net_connect, device_type='cisco_ios')
# Now just do your normal Netmiko operations
new_output = net_connect.send_command("show ip int brief")
```

### Installing Netmiko `develop` branch (with Poetry support)

To install the Netmiko `develop` branch follow this process.

1. Install Python poetry. This should be documented online.
2. export PATH="/home/<user>/.local/bin:$PATH" # make sure poetry is on your $PATH
3. git clone https://github.com/ktbyers/netmiko
4. cd netmiko # change dir into the base of the Netmiko repository.
5. Create a new virtual environment

```
# Use the appropriate python3 for your machine
# This creates a virtual environment named .venv
python3.10 -m venv .venv
```

6. source .venv/bin/activate # Activate virtual env
7. poetry install # Install all of the Netmiko dependencies
2 changes: 1 addition & 1 deletion EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img src="https://github.com/ktbyers/netmiko/blob/improved_examples/images/netmiko_logo_gh.png" width="320">
<img src="https://ktbyers.github.io/netmiko/images/netmiko_logo_gh.png" width="320">

Netmiko Examples
=======
Expand Down
28 changes: 23 additions & 5 deletions PLATFORMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
###### Regularly tested

- Arista vEOS
- Cisco ASA
- Cisco IOS
- Cisco IOS-XE
- Cisco IOS-XR
Expand All @@ -17,24 +16,30 @@

- 6Wind
- Adtran OS
- Adva AOS FSP150
- Adva AOS FSP150 F2 & F3
- Alcatel AOS6/AOS8
- Apresia Systems AEOS
- ARRIS CER
- AudioCodes Gateways & Controllers
- Broadcom ICOS
- Calix B6
- Casa Systems CMTS
- Centec Networks
- Cisco AireOS (Wireless LAN Controllers)
- Cisco ASA
- Cisco S200
- CloudGenix ION
- Dell OS9 (Force10)
- Dell OS10
- Dell PowerConnect
- Ericsson IPOS
- Ericsson MINI-LINK 66XX & 63XX
- Extreme ERS (Avaya)
- Extreme MLX/NetIron (Brocade/Foundry)
- Extreme TierraOS
- Extreme VDX (Brocade)
- Extreme VSP (Avaya)
- Fiberstore FSOS
- Hillstone StoneOS
- HPE Comware7
- Huawei
Expand All @@ -55,6 +60,7 @@
- Ruckus ICX/FastIron
- Ruijie Networks
- Supermicro SMIS
- Teldat CIT
- TPLink JetStream
- Ubiquiti EdgeSwitch
- Vyatta VyOS
Expand All @@ -67,10 +73,8 @@
- Accedian
- Allied Telesis AlliedWare Plus
- Aruba
- Arris CER
- Brocade Fabric OS
- C-DOT CROS
- Casa CMTS
- Ciena SAOS
- Citrix Netscaler
- Cisco Telepresence
Expand Down Expand Up @@ -118,6 +122,9 @@
- aruba_os
- aruba_osswitch
- aruba_procurve
- audiocode_66
- audiocode_72
- audiocode_shell
- avaya_ers
- avaya_vsp
- broadcom_icos
Expand All @@ -137,6 +144,7 @@
- cisco_ftd
- cisco_ios
- cisco_nxos
- cisco_s200
- cisco_s300
- cisco_tp
- cisco_viptela
Expand All @@ -159,6 +167,8 @@
- endace
- enterasys
- ericsson_ipos
- ericsson_mltn63
- ericsson_mltn66
- extreme
- extreme_ers
- extreme_exos
Expand All @@ -182,6 +192,7 @@
- huawei
- huawei_olt
- huawei_smartax
- huawei_vrp
- huawei_vrpv8
- ipinfusion_ocnos
- juniper
Expand All @@ -199,8 +210,8 @@
- netapp_cdot
- netgear_prosafe
- netscaler
- nokia_sros
- nokia_srl
- nokia_sros
- oneaccess_oneos
- ovs_linux
- paloalto_panos
Expand All @@ -213,6 +224,7 @@
- sixwind_os
- sophos_sfos
- supermicro_smis
- teldat_cit
- tplink_jetstream
- ubiquiti_edge
- ubiquiti_edgerouter
Expand All @@ -231,13 +243,17 @@
- apresia_aeos_telnet
- arista_eos_telnet
- aruba_procurve_telnet
- audiocode_72_telnet
- audiocode_66_telnet
- audiocode_shell_telnet
- brocade_fastiron_telnet
- brocade_netiron_telnet
- calix_b6_telnet
- centec_os_telnet
- ciena_saos_telnet
- cisco_ios_telnet
- cisco_xr_telnet
- cisco_s200_telnet
- cisco_s300_telnet
- dell_dnos6_telnet
- dell_powerconnect_telnet
Expand All @@ -261,6 +277,7 @@
- ruckus_fastiron_telnet
- ruijie_os_telnet
- supermicro_smis_telnet
- teldat_cit_telnet
- tplink_jetstream_telnet
- yamaha_telnet
- zte_zxros_telnet
Expand All @@ -279,3 +296,4 @@
- juniper_junos
- linux
- nokia_sros
- ubiquiti_edgerouter
4 changes: 2 additions & 2 deletions _release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ while true; do
esac
done

pylama
pylama .
if [ $? -eq 0 ]; then
echo
echo "pylama ... [OK]"
Expand All @@ -32,7 +32,7 @@ else
fi

echo
python setup.py sdist bdist_wheel > /dev/null
poetry build > /dev/null
if [ $? -eq 0 ]; then
echo "creating distribution ... [OK]"
ls -ltr $DIR_PACKAGE
Expand Down
18 changes: 15 additions & 3 deletions docs/netmiko/a10/a10_ssh.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="netmiko.a10.a10_ssh.A10SSH"><code class="flex name class">
<span>class <span class="ident">A10SSH</span></span>
<span>(</span><span>ip: str = '', host: str = '', username: str = '', password: Optional[str] = None, secret: str = '', port: Optional[int] = None, device_type: str = '', verbose: bool = False, global_delay_factor: float = 1.0, global_cmd_verify: Optional[bool] = None, use_keys: bool = False, key_file: Optional[str] = None, pkey: Optional[paramiko.pkey.PKey] = None, passphrase: Optional[str] = None, disabled_algorithms: Optional[Dict[str, Any]] = None, allow_agent: bool = False, ssh_strict: bool = False, system_host_keys: bool = False, alt_host_keys: bool = False, alt_key_file: str = '', ssh_config_file: Optional[str] = None, conn_timeout: int = 10, auth_timeout: Optional[int] = None, banner_timeout: int = 15, blocking_timeout: int = 20, timeout: int = 100, session_timeout: int = 60, read_timeout_override: Optional[float] = None, keepalive: int = 0, default_enter: Optional[str] = None, response_return: Optional[str] = None, serial_settings: Optional[Dict[str, Any]] = None, fast_cli: bool = True, session_log: Optional[<a title="netmiko.session_log.SessionLog" href="../session_log.html#netmiko.session_log.SessionLog">SessionLog</a>] = None, session_log_record_writes: bool = False, session_log_file_mode: str = 'write', allow_auto_change: bool = False, encoding: str = 'utf-8', sock: Optional[socket.socket] = None, auto_connect: bool = True, delay_factor_compat: bool = False)</span>
<span>(</span><span>ip: str = '', host: str = '', username: str = '', password: Optional[str] = None, secret: str = '', port: Optional[int] = None, device_type: str = '', verbose: bool = False, global_delay_factor: float = 1.0, global_cmd_verify: Optional[bool] = None, use_keys: bool = False, key_file: Optional[str] = None, pkey: Optional[paramiko.pkey.PKey] = None, passphrase: Optional[str] = None, disabled_algorithms: Optional[Dict[str, Any]] = None, disable_sha2_fix: bool = False, allow_agent: bool = False, ssh_strict: bool = False, system_host_keys: bool = False, alt_host_keys: bool = False, alt_key_file: str = '', ssh_config_file: Optional[str] = None, conn_timeout: int = 10, auth_timeout: Optional[int] = None, banner_timeout: int = 15, blocking_timeout: int = 20, timeout: int = 100, session_timeout: int = 60, read_timeout_override: Optional[float] = None, keepalive: int = 0, default_enter: Optional[str] = None, response_return: Optional[str] = None, serial_settings: Optional[Dict[str, Any]] = None, fast_cli: bool = True, session_log: Optional[<a title="netmiko.session_log.SessionLog" href="../session_log.html#netmiko.session_log.SessionLog">SessionLog</a>] = None, session_log_record_writes: bool = False, session_log_file_mode: str = 'write', allow_auto_change: bool = False, encoding: str = 'utf-8', sock: Optional[socket.socket] = None, auto_connect: bool = True, delay_factor_compat: bool = False, disable_lf_normalization: bool = False)</span>
</code></dt>
<dd>
<div class="desc"><p>A10 support.</p>
Expand Down Expand Up @@ -103,6 +103,9 @@ <h2 class="section-title" id="header-classes">Classes</h2>
:param disabled_algorithms: Dictionary of SSH algorithms to disable. Refer to the Paramiko
documentation for a description of the expected format.

:param disable_sha2_fix: Boolean that fixes Paramiko issue with missing server-sig-algs
&lt;https://github.com/paramiko/paramiko/issues/1961&gt; (default: False)

:param allow_agent: Enable use of SSH key-agent.

:param ssh_strict: Automatically reject unknown SSH host keys (default: False, which
Expand All @@ -117,14 +120,18 @@ <h2 class="section-title" id="header-classes">Classes</h2>

:param ssh_config_file: File name of OpenSSH configuration file.

:param timeout: Connection timeout.
:param conn_timeout: TCP connection timeout.

:param session_timeout: Set a timeout for parallel requests.

:param auth_timeout: Set a timeout (in seconds) to wait for an authentication response.

:param banner_timeout: Set a timeout to wait for the SSH banner (pass to Paramiko).

:param read_timeout_override: Set a timeout that will override the default read_timeout
of both send_command and send_command_timing. This is useful for 3rd party
libraries where directly accessing method arguments might be impractical.

:param keepalive: Send SSH keepalive packets at a specific interval, in seconds.
Currently defaults to 0, for backwards compatibility (it will not attempt
to keep the connection alive).
Expand All @@ -136,7 +143,9 @@ <h2 class="section-title" id="header-classes">Classes</h2>
enter key (default:
</code></pre>
<p>)</p>
<pre><code> :param fast_cli: Provide a way to optimize for performance. Converts select_delay_factor
<pre><code> :param serial_settings: Dictionary of settings for use with serial port (pySerial).

:param fast_cli: Provide a way to optimize for performance. Converts select_delay_factor
to select smallest of global and specific. Sets default global_delay_factor to .1
(default: True)

Expand Down Expand Up @@ -168,6 +177,9 @@ <h2 class="section-title" id="header-classes">Classes</h2>
:param delay_factor_compat: Set send_command and send_command_timing back to using Netmiko
3.x behavior for delay_factor/global_delay_factor/max_loops. This argument will be
eliminated in Netmiko 5.x (default: False).

:param disable_lf_normalization: Disable Netmiko's linefeed normalization behavior
(default: False)
</code></pre></div>
<details class="source">
<summary>
Expand Down
Loading

0 comments on commit 2b5dbf1

Please sign in to comment.