Skip to content

Commit

Permalink
Develop (#35)
Browse files Browse the repository at this point in the history
- Add Siemens ROX II (thank you again Khiem Nguyen!) -- see #31
- Updated privilege level imports location to match scrapli core overhaul
  • Loading branch information
carlmontanari authored Feb 8, 2021
1 parent 69901e6 commit 52d04f6
Show file tree
Hide file tree
Showing 84 changed files with 1,708 additions and 300 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/weekly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Weekly Build

on:
schedule:
# weekly at 0700 PST/1400 UTC on Sunday
- cron: '0 14 * * 0'
# weekly at 0300 PST/1000 UTC on Sunday
- cron: '0 10 * * 0'
workflow_dispatch:

# in the future make this just call the commit workflow, but right now looks a little hacky to do in actions
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
CHANGELOG
=======

# 2021.01.30
- Add Siemens ROX II (thank you again Khiem Nguyen!) -- see #31
- Updated privilege level imports location to match scrapli core overhaul


# 2020.11.15
- Add Fortinet WLC (thank you again Alex!) -- see #6
- Add Aethra ATOSNT (Alex!!!) -- see #9
- Fix screen width on Huawei VRP (Alex again!) -- see #18


# 2020.09.19
- Add Ruckus Fastiron Platform (thank you Brett!)
- Add Edgecore ECS Platform (thank you Alex!)
- Add some bits to the example scrapli driver for testing purposes for scrapli core ++ supporting users creating
their own device classes so they can build custom methods/override existing methods
- Add 3.9 to weekly/commit testing


# 2020.08.08
- First draft of scrapli_community!
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Carl Montanari
Copyright (c) 2021 Carl Montanari

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,15 @@ conn.open()

The following are the currently supported platforms:

| Platform Name | Vendor | OS | Contributor(s) | Last Update | Notes |
|-----------------------|-----------------|---------------|------------------------------------------------------|-------------|---------------------------------------------------------------------------------------|
| ruckus_fastiron | Ruckus | FastIron | [Brett Canter](https://github.com/wonderbred) | 2020.08.08 | |
| huawei_vrp | Huawei | VRP | [Alex Lardschneider](https://github.com/AlexLardschneider) | 2020.11.13 | Last update fixed minor prompt pattern issue (missing underscore)<br><br>Might need to manually set `screen-width` or PTY cols, see issue [#18](https://github.com/scrapli/scrapli_community/issues/18) for more details. |
| edgecore_ecs | Edgecore | ECS | [Alex Lardschneider](https://github.com/AlexLardschneider) | 2020.09.19 | For the firmware shipped by Edgecore itself |
| fortinet_wlc | Fortinet | WLC | [Alex Lardschneider](https://github.com/AlexLardschneider) | 2020.XX.XX | For the Meru-based OS, not the same as FortiOS |
| aethra_atosnt | Aethra | ATOSNT | [Alex Lardschneider](https://github.com/AlexLardschneider) | 2020.XX.XX | Tested on ATOS NT, ranging from 6.3.X up to 6.5.X: |
| Platform Name | Vendor | OS | Contributor(s) | Last Update | Notes |
|-----------------------|-----------------|---------------|------------------------------------------------------------|-------------|---------------------------------------------------------------------------------------|
| ruckus_fastiron | Ruckus | FastIron | [Brett Canter](https://github.com/wonderbred) | 2020.08.08 | |
| huawei_vrp | Huawei | VRP | [Alex Lardschneider](https://github.com/AlexLardschneider) | 2020.11.13 | Last update fixed minor prompt pattern issue (missing underscore)<br><br>Might need to manually set `screen-width` or PTY cols, see issue [#18](https://github.com/scrapli/scrapli_community/issues/18) for more details. |
| edgecore_ecs | Edgecore | ECS | [Alex Lardschneider](https://github.com/AlexLardschneider) | 2020.09.19 | For the firmware shipped by Edgecore itself |
| fortinet_wlc | Fortinet | WLC | [Alex Lardschneider](https://github.com/AlexLardschneider) | 2020.11.15 | For the Meru-based OS, not the same as FortiOS |
| aethra_atosnt | Aethra | ATOSNT | [Alex Lardschneider](https://github.com/AlexLardschneider) | 2020.11.15 | Tested on ATOS NT, ranging from 6.3.X up to 6.5.X: |
| aethra_atosnt | Mikrotik | RouterOS | [Alex Lardschneider](https://github.com/AlexLardschneider) | 2020.11.15 | |
| siemens_roxii | Siemens | ROX II | [Khiem Nguyen](https://github.com/kn-winter) | 2021.01.30 | |


# Why add a Platform
Expand All @@ -130,13 +132,11 @@ def wlc_on_open(cls):
# time.sleeps here are just because my test device was a bit sluggish, without these scrapli is
# just going to send the username/password right away
time.sleep(0.25)
# since the channel isn't fully setup, we access the transport and send the commands directly
# note that when accessing the transport directly we need to manually send the return char
cls.transport.write(cls.transport.auth_username)
cls.transport.write(cls.channel.comms_return_char)
cls.channel.write(cls.auth_username)
cls.channel.send_return()
time.sleep(0.25)
cls.transport.write(cls.transport.auth_password)
cls.transport.write(cls.channel.comms_return_char)
cls.channel.write(cls.auth_password)
cls.channel.send_return()
wlc = {
Expand Down
16 changes: 7 additions & 9 deletions docs/scrapli_community/aethra/atosnt/sync.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ <h1 class="title">Module <code>scrapli_community.aethra.atosnt.sync</code></h1>

Raises:
N/A

&#34;&#34;&#34;
# write exit directly to the transport as channel would fail to find the prompt after sending
# the exit command!
conn.transport.write(channel_input=&#34;\x04&#34;)
conn.transport.write(channel_input=conn.channel.comms_return_char)</code></pre>
conn.channel.write(channel_input=&#34;\x04&#34;)
conn.channel.send_return()</code></pre>
</details>
</section>
<section>
Expand All @@ -58,7 +57,7 @@ <h1 class="title">Module <code>scrapli_community.aethra.atosnt.sync</code></h1>
<h2 class="section-title" id="header-functions">Functions</h2>
<dl>
<dt id="scrapli_community.aethra.atosnt.sync.default_sync_on_close"><code class="name flex">
<span>def <span class="ident">default_sync_on_close</span></span>(<span>conn: scrapli.driver.generic_driver.GenericDriver) ‑> NoneType</span>
<span>def <span class="ident">default_sync_on_close</span></span>(<span>conn: scrapli.driver.generic.sync_driver.GenericDriver) ‑> NoneType</span>
</code></dt>
<dd>
<div class="desc"><p>aethra_atosnt default on_close callable</p>
Expand Down Expand Up @@ -88,11 +87,10 @@ <h2 id="raises">Raises</h2>

Raises:
N/A

&#34;&#34;&#34;
# write exit directly to the transport as channel would fail to find the prompt after sending
# the exit command!
conn.transport.write(channel_input=&#34;\x04&#34;)
conn.transport.write(channel_input=conn.channel.comms_return_char)</code></pre>
conn.channel.write(channel_input=&#34;\x04&#34;)
conn.channel.send_return()</code></pre>
</details>
</dd>
</dl>
Expand Down
9 changes: 8 additions & 1 deletion docs/scrapli_community/aethra/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.8.4" />
<title>scrapli_community.aethra API documentation</title>
<meta name="description" content="" />
<meta name="description" content="scrapli_community.atosnt" />
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/github.min.css" crossorigin>
Expand All @@ -22,6 +22,13 @@
<h1 class="title">Module <code>scrapli_community.aethra</code></h1>
</header>
<section id="section-intro">
<p>scrapli_community.atosnt</p>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">&#34;&#34;&#34;scrapli_community.atosnt&#34;&#34;&#34;</code></pre>
</details>
</section>
<section>
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
Expand Down
2 changes: 1 addition & 1 deletion docs/scrapli_community/edgecore/ecs/edgecore_ecs.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1 class="title">Module <code>scrapli_community.edgecore.ecs.edgecore_ecs</code
<span>Expand source code</span>
</summary>
<pre><code class="python">&#34;&#34;&#34;scrapli_community.edgecore.ecs.edgecore_ecs&#34;&#34;&#34;
from scrapli.driver.base_network_driver import PrivilegeLevel
from scrapli.driver.network.base_driver import PrivilegeLevel

from scrapli_community.edgecore.ecs._async import default_async_on_close, default_async_on_open
from scrapli_community.edgecore.ecs.sync import default_sync_on_close, default_sync_on_open
Expand Down
18 changes: 8 additions & 10 deletions docs/scrapli_community/edgecore/ecs/sync.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ <h1 class="title">Module <code>scrapli_community.edgecore.ecs.sync</code></h1>

Raises:
N/A

&#34;&#34;&#34;
conn.acquire_priv(desired_priv=conn.default_desired_privilege_level)

Expand All @@ -63,12 +64,10 @@ <h1 class="title">Module <code>scrapli_community.edgecore.ecs.sync</code></h1>
Raises:
N/A
&#34;&#34;&#34;
# write exit directly to the transport as channel would fail to find the prompt after sending
# the exit command!
conn.acquire_priv(desired_priv=conn.default_desired_privilege_level)

conn.transport.write(channel_input=&#34;exit&#34;)
conn.transport.write(channel_input=conn.channel.comms_return_char)</code></pre>
conn.channel.write(channel_input=&#34;exit&#34;)
conn.channel.send_return()</code></pre>
</details>
</section>
<section>
Expand All @@ -79,7 +78,7 @@ <h1 class="title">Module <code>scrapli_community.edgecore.ecs.sync</code></h1>
<h2 class="section-title" id="header-functions">Functions</h2>
<dl>
<dt id="scrapli_community.edgecore.ecs.sync.default_sync_on_close"><code class="name flex">
<span>def <span class="ident">default_sync_on_close</span></span>(<span>conn: scrapli.driver.network_driver.NetworkDriver) ‑> NoneType</span>
<span>def <span class="ident">default_sync_on_close</span></span>(<span>conn: scrapli.driver.network.sync_driver.NetworkDriver) ‑> NoneType</span>
</code></dt>
<dd>
<div class="desc"><p>edgecore_ecs default on_close callable</p>
Expand Down Expand Up @@ -110,16 +109,14 @@ <h2 id="raises">Raises</h2>
Raises:
N/A
&#34;&#34;&#34;
# write exit directly to the transport as channel would fail to find the prompt after sending
# the exit command!
conn.acquire_priv(desired_priv=conn.default_desired_privilege_level)

conn.transport.write(channel_input=&#34;exit&#34;)
conn.transport.write(channel_input=conn.channel.comms_return_char)</code></pre>
conn.channel.write(channel_input=&#34;exit&#34;)
conn.channel.send_return()</code></pre>
</details>
</dd>
<dt id="scrapli_community.edgecore.ecs.sync.default_sync_on_open"><code class="name flex">
<span>def <span class="ident">default_sync_on_open</span></span>(<span>conn: scrapli.driver.network_driver.NetworkDriver) ‑> NoneType</span>
<span>def <span class="ident">default_sync_on_open</span></span>(<span>conn: scrapli.driver.network.sync_driver.NetworkDriver) ‑> NoneType</span>
</code></dt>
<dd>
<div class="desc"><p>edgecore_ecs on_open callable</p>
Expand Down Expand Up @@ -149,6 +146,7 @@ <h2 id="raises">Raises</h2>

Raises:
N/A

&#34;&#34;&#34;
conn.acquire_priv(desired_priv=conn.default_desired_privilege_level)

Expand Down
9 changes: 8 additions & 1 deletion docs/scrapli_community/edgecore/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.8.4" />
<title>scrapli_community.edgecore API documentation</title>
<meta name="description" content="" />
<meta name="description" content="scrapli_community.edgecore" />
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/github.min.css" crossorigin>
Expand All @@ -22,6 +22,13 @@
<h1 class="title">Module <code>scrapli_community.edgecore</code></h1>
</header>
<section id="section-intro">
<p>scrapli_community.edgecore</p>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">&#34;&#34;&#34;scrapli_community.edgecore&#34;&#34;&#34;</code></pre>
</details>
</section>
<section>
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
Expand Down
Loading

0 comments on commit 52d04f6

Please sign in to comment.