Skip to content

Commit 3c39dcb

Browse files
authored
Merge pull request #97 from CiscoTestAutomation/release_24.3
Release 24.3
2 parents ddf617c + 9e8c3f2 commit 3c39dcb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+682
-73
lines changed

docs/changelog/2024/march.rst

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
March 2024
2+
==========
3+
4+
- Unicon v24.3
5+
------------------------
6+
7+
8+
9+
.. csv-table:: Module Versions
10+
:header: "Modules", "Versions"
11+
12+
``unicon.plugins``, v24.3
13+
``unicon``, v24.3
14+
15+
Install Instructions
16+
^^^^^^^^^^^^^^^^^^^^
17+
18+
.. code-block:: bash
19+
20+
bash$ pip install unicon.plugins
21+
bash$ pip install unicon
22+
23+
Upgrade Instructions
24+
^^^^^^^^^^^^^^^^^^^^
25+
26+
.. code-block:: bash
27+
28+
bash$ pip install --upgrade unicon.plugins
29+
bash$ pip install --upgrade unicon
30+
31+
Features and Bug Fixes:
32+
^^^^^^^^^^^^^^^^^^^^^^^
33+
34+
35+
36+
37+
Changelogs
38+
^^^^^^^^^^
39+
--------------------------------------------------------------------------------
40+
New
41+
--------------------------------------------------------------------------------
42+
43+
* backend
44+
* Option to use `UNICON_BACKEND` environment variable to select backend
45+
46+
47+
--------------------------------------------------------------------------------
48+
Fix
49+
--------------------------------------------------------------------------------
50+
51+
* bases
52+
* connection
53+
* add operating_mode to the connection object
54+
55+
56+
--------------------------------------------------------------------------------
57+
New
58+
--------------------------------------------------------------------------------
59+
60+
* discovery_tokens
61+
* Add prompt_recovery to dialog
62+
63+
* iosxe
64+
* Connection provider
65+
* Add support for operating mode detection on connect()
66+
67+
68+
--------------------------------------------------------------------------------
69+
Fix
70+
--------------------------------------------------------------------------------
71+
72+
* iosxr
73+
* Modified connection provider
74+
* Updated connection provider for handeling token discovery.
75+
76+

docs/changelog/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changelog
44
.. toctree::
55
:maxdepth: 2
66

7+
2024/march
78
2024/february
89
2024/january
910
2023/november
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
March 2024
2+
==========
3+
4+
- Unicon.Plugins v24.3
5+
------------------------
6+
7+
8+
9+
.. csv-table:: Module Versions
10+
:header: "Modules", "Versions"
11+
12+
``unicon.plugins``, v24.3
13+
``unicon``, v24.3
14+
15+
Install Instructions
16+
^^^^^^^^^^^^^^^^^^^^
17+
18+
.. code-block:: bash
19+
20+
bash$ pip install unicon.plugins
21+
bash$ pip install unicon
22+
23+
Upgrade Instructions
24+
^^^^^^^^^^^^^^^^^^^^
25+
26+
.. code-block:: bash
27+
28+
bash$ pip install --upgrade unicon.plugins
29+
bash$ pip install --upgrade unicon
30+
31+
Features and Bug Fixes:
32+
^^^^^^^^^^^^^^^^^^^^^^^
33+
34+
35+
36+
37+
Changelogs
38+
^^^^^^^^^^
39+
--------------------------------------------------------------------------------
40+
Fix
41+
--------------------------------------------------------------------------------
42+
43+
* cheetah/ap
44+
* Add more prompt handler to statemachine
45+
46+
* token discovery
47+
* Add more prompt to dialog
48+
* Update dialog timeout
49+
50+
* generic
51+
* Added encryption selection pattern
52+
* Removed duplicate enable_secret_handler and setup_enter_selection functions
53+
54+

docs/changelog_plugins/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Plugins Changelog
44
.. toctree::
55
:maxdepth: 2
66

7+
2024/march
78
2024/february
89
2024/january
910
2023/november

src/unicon/plugins/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '24.2'
1+
__version__ = '24.3'
22

33
supported_chassis = [
44
'single_rp',

src/unicon/plugins/cheetah/ap/statemachine.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from unicon.plugins.generic.statemachine import GenericSingleRpStateMachine
2-
from unicon.plugins.generic.statements import GenericStatements
2+
from unicon.plugins.generic.statements import GenericStatements, default_statement_list
33
from unicon.statemachine import State, Path, StateMachine
44
from unicon.eal.dialogs import Dialog, Statement
55
from unicon.plugins.generic.patterns import GenericPatterns
@@ -46,3 +46,5 @@ def create(self):
4646
self.add_path(enable_to_shell)
4747
self.add_path(shell_to_enable)
4848
self.add_path(enable_to_disable)
49+
50+
self.add_default_statements(default_statement_list)

src/unicon/plugins/generic/connection_provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ def get_connection_dialog(self):
6767
self.connection.settings.PASSWORD_PROMPT)
6868
return con.connect_reply + \
6969
Dialog(custom_auth_stmt + connection_statement_list
70-
if custom_auth_stmt else connection_statement_list)
70+
if custom_auth_stmt else connection_statement_list)

src/unicon/plugins/generic/patterns.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,5 @@ def __init__(self):
8585
self.get_cursor_position = r'\x1b\[6n'
8686

8787
self.new_password = r'^(Enter new password|Confirm password):\s*$'
88+
89+
self.enter_your_encryption_selection_2 = r'^.*?Enter your encryption selection( \[2])?:\s*$'

src/unicon/plugins/generic/service_statements.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ def config_session_locked_handler(context):
354354
generic_statements.syslog_msg_stmt,
355355
# Below statements have loop_continue=False
356356
password_stmt, press_enter, press_return,
357-
connection_closed_stmt, eof_statement
357+
connection_closed_stmt, eof_statement,
358+
generic_statements.enter_your_encryption_selection_stmt
358359
]
359360

360361
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#

src/unicon/plugins/generic/statements.py

Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,16 @@ def syslog_wait_send_return(spawn, session):
131131
session['buffer_len'] = len(spawn.buffer)
132132

133133

134-
def chatty_term_wait(spawn, trim_buffer=False):
134+
def chatty_term_wait(spawn, trim_buffer=False, wait_time=None):
135135
""" Wait some time for any chatter to cease from the device.
136136
"""
137+
chatty_wait_time = wait_time or spawn.settings.ESCAPE_CHAR_CHATTY_TERM_WAIT
137138
for retry_number in range(spawn.settings.ESCAPE_CHAR_CHATTY_TERM_WAIT_RETRIES):
138139

139-
if buffer_settled(spawn, spawn.settings.ESCAPE_CHAR_CHATTY_TERM_WAIT):
140+
if buffer_settled(spawn, chatty_wait_time):
140141
break
141142
else:
142-
buffer_wait(spawn, spawn.settings.ESCAPE_CHAR_CHATTY_TERM_WAIT * (retry_number + 1))
143+
buffer_wait(spawn, chatty_wait_time * (retry_number + 1))
143144

144145
else:
145146
spawn.log.warning('The buffer has not settled because the device is chatty. '
@@ -334,35 +335,6 @@ def setup_enter_selection(spawn, context):
334335
spawn.sendline('2')
335336

336337

337-
def enable_secret_handler(spawn, context, session):
338-
if 'password_attempts' not in session:
339-
session['password_attempts'] = 1
340-
else:
341-
session['password_attempts'] += 1
342-
if session.password_attempts > spawn.settings.PASSWORD_ATTEMPTS:
343-
raise UniconAuthenticationError('Too many enable password retries')
344-
345-
enable_credential_password = get_enable_credential_password(context=context)
346-
if enable_credential_password and len(enable_credential_password) >= \
347-
spawn.settings.ENABLE_SECRET_MIN_LENGTH:
348-
spawn.sendline(enable_credential_password)
349-
else:
350-
spawn.log.warning('Using enable secret from TEMP_ENABLE_SECRET setting')
351-
enable_secret = spawn.settings.TEMP_ENABLE_SECRET
352-
context['setup_selection'] = 0
353-
spawn.sendline(enable_secret)
354-
355-
356-
def setup_enter_selection(spawn, context):
357-
selection = context.get('setup_selection')
358-
if selection is not None:
359-
if str(selection) == '0':
360-
spawn.log.warning('Not saving setup configuration')
361-
spawn.sendline(f'{selection}')
362-
else:
363-
spawn.sendline('2')
364-
365-
366338
def ssh_tacacs_handler(spawn, context):
367339
result = False
368340
start_cmd = spawn.spawn_command
@@ -758,6 +730,12 @@ def __init__(self):
758730
loop_continue=True,
759731
continue_timer=False)
760732

733+
self.enter_your_encryption_selection_stmt = Statement(pattern=pat.enter_your_encryption_selection_2,
734+
action=setup_enter_selection,
735+
args=None,
736+
loop_continue=True,
737+
continue_timer=True)
738+
761739
#############################################################
762740
# Statement lists
763741
#############################################################
@@ -803,7 +781,8 @@ def __init__(self):
803781

804782
initial_statement_list = [generic_statements.init_conf_stmt,
805783
generic_statements.mgmt_setup_stmt,
806-
generic_statements.enter_your_selection_stmt
784+
generic_statements.enter_your_selection_stmt,
785+
generic_statements.enter_your_encryption_selection_stmt
807786
]
808787

809788

@@ -817,4 +796,5 @@ def __init__(self):
817796
default_statement_list + \
818797
authentication_statement_list + \
819798
initial_statement_list + \
820-
pre_connection_statement_list
799+
pre_connection_statement_list
800+

0 commit comments

Comments
 (0)