-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from CiscoTestAutomation/release_24.3
Release 24.3
- Loading branch information
Showing
42 changed files
with
682 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
March 2024 | ||
========== | ||
|
||
- Unicon v24.3 | ||
------------------------ | ||
|
||
|
||
|
||
.. csv-table:: Module Versions | ||
:header: "Modules", "Versions" | ||
|
||
``unicon.plugins``, v24.3 | ||
``unicon``, v24.3 | ||
|
||
Install Instructions | ||
^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. code-block:: bash | ||
bash$ pip install unicon.plugins | ||
bash$ pip install unicon | ||
Upgrade Instructions | ||
^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. code-block:: bash | ||
bash$ pip install --upgrade unicon.plugins | ||
bash$ pip install --upgrade unicon | ||
Features and Bug Fixes: | ||
^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
|
||
|
||
|
||
Changelogs | ||
^^^^^^^^^^ | ||
-------------------------------------------------------------------------------- | ||
New | ||
-------------------------------------------------------------------------------- | ||
|
||
* backend | ||
* Option to use `UNICON_BACKEND` environment variable to select backend | ||
|
||
|
||
-------------------------------------------------------------------------------- | ||
Fix | ||
-------------------------------------------------------------------------------- | ||
|
||
* bases | ||
* connection | ||
* add operating_mode to the connection object | ||
|
||
|
||
-------------------------------------------------------------------------------- | ||
New | ||
-------------------------------------------------------------------------------- | ||
|
||
* discovery_tokens | ||
* Add prompt_recovery to dialog | ||
|
||
* iosxe | ||
* Connection provider | ||
* Add support for operating mode detection on connect() | ||
|
||
|
||
-------------------------------------------------------------------------------- | ||
Fix | ||
-------------------------------------------------------------------------------- | ||
|
||
* iosxr | ||
* Modified connection provider | ||
* Updated connection provider for handeling token discovery. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ Changelog | |
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
2024/march | ||
2024/february | ||
2024/january | ||
2023/november | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
March 2024 | ||
========== | ||
|
||
- Unicon.Plugins v24.3 | ||
------------------------ | ||
|
||
|
||
|
||
.. csv-table:: Module Versions | ||
:header: "Modules", "Versions" | ||
|
||
``unicon.plugins``, v24.3 | ||
``unicon``, v24.3 | ||
|
||
Install Instructions | ||
^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. code-block:: bash | ||
bash$ pip install unicon.plugins | ||
bash$ pip install unicon | ||
Upgrade Instructions | ||
^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. code-block:: bash | ||
bash$ pip install --upgrade unicon.plugins | ||
bash$ pip install --upgrade unicon | ||
Features and Bug Fixes: | ||
^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
|
||
|
||
|
||
Changelogs | ||
^^^^^^^^^^ | ||
-------------------------------------------------------------------------------- | ||
Fix | ||
-------------------------------------------------------------------------------- | ||
|
||
* cheetah/ap | ||
* Add more prompt handler to statemachine | ||
|
||
* token discovery | ||
* Add more prompt to dialog | ||
* Update dialog timeout | ||
|
||
* generic | ||
* Added encryption selection pattern | ||
* Removed duplicate enable_secret_handler and setup_enter_selection functions | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ Plugins Changelog | |
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
2024/march | ||
2024/february | ||
2024/january | ||
2023/november | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
__version__ = '24.2' | ||
__version__ = '24.3' | ||
|
||
supported_chassis = [ | ||
'single_rp', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
|
||
import re | ||
from unicon.eal.dialogs import Dialog | ||
from unicon.eal.dialogs import Statement | ||
from unicon.plugins.generic.connection_provider import GenericSingleRpConnectionProvider | ||
from unicon.plugins.generic.patterns import GenericPatterns | ||
from unicon.statemachine import State | ||
from unicon.plugins.generic.statements import chatty_term_wait | ||
from unicon.plugins.utils import get_device_mode | ||
|
||
|
||
class IosxeSingleRpConnectionProvider(GenericSingleRpConnectionProvider): | ||
""" Implements Iosxe singleRP Connection Provider, | ||
This class overrides the base class with the | ||
additional dialogs and steps required for | ||
connecting to any device via generic implementation | ||
""" | ||
def __init__(self, *args, **kwargs): | ||
|
||
""" Initializes the generic connection provider | ||
""" | ||
super().__init__(*args, **kwargs) | ||
|
||
|
||
def learn_tokens(self): | ||
con = self.connection | ||
if (not con.learn_tokens or not con.settings.LEARN_DEVICE_TOKENS)\ | ||
and not con.operating_mode: | ||
# make sure device is in valid unicon state | ||
con.sendline() | ||
con.state_machine.go_to('any', | ||
con.spawn, | ||
context=con.context, | ||
prompt_recovery=con.prompt_recovery) | ||
# If the learn token is not enabled we need to see if the device is in Controller-Managed mode | ||
# or it's in autonomous mode. If the device is in Controller-Managed mode, enable token discovery. | ||
if get_device_mode(con) == 'Controller-Managed': | ||
# The device is in Controller-Manged mode so we need to learn the abstraction tokens. | ||
con.overwrite_testbed_tokens = True | ||
con.learn_tokens = True | ||
# "operating_mode" attribute is added to the connection object to avoid getting in a loop | ||
con.operating_mode = True | ||
# Add learn tokens state to state machine so it can use a looser | ||
# prompt pattern to match. Required for at least some Linux prompts | ||
if 'learn_tokens_state' not in [str(s) for s in con.state_machine.states]: | ||
self.learn_tokens_state = State('learn_tokens_state', | ||
GenericPatterns().learn_os_prompt) | ||
con.state_machine.add_state(self.learn_tokens_state) | ||
|
||
# The first thing we need to is to send stop PnP discovery otherwise device will not execute any command. | ||
con.spawn.sendline('pnpa service discovery stop') | ||
# The device may reload after the command we get the dialog statements from reload service and try to handle that | ||
dialog = con.reload.dialog | ||
dialog.append(Statement(pattern=GenericPatterns().enable_prompt,action=None, | ||
args=None, loop_continue=False, continue_timer=False)) | ||
dialog.process(con.spawn, | ||
context=con.context, | ||
timeout=con.settings.RELOAD_WAIT, | ||
prompt_recovery=con.prompt_recovery) | ||
# The device may be chatty at this time we need to wait for | ||
# it to to settle down. | ||
chatty_wait_time = con.settings.CONTROLLER_MODE_CHATTY_WAIT_TIME | ||
chatty_term_wait(con.spawn, trim_buffer=True, wait_time=chatty_wait_time) | ||
con.sendline() | ||
con.state_machine.go_to('any', | ||
con.spawn, | ||
context=con.context, | ||
prompt_recovery=con.prompt_recovery) | ||
super().learn_tokens() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.