Skip to content

Commit

Permalink
Releasing v24.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Ryan committed May 27, 2024
1 parent 85e2791 commit c361060
Show file tree
Hide file tree
Showing 17 changed files with 355 additions and 12 deletions.
59 changes: 59 additions & 0 deletions docs/changelog/2024/may.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
May 2024
==========

May 28 - Unicon v24.5
------------------------



.. csv-table:: Module Versions
:header: "Modules", "Versions"

``unicon.plugins``, v24.5
``unicon``, v24.5

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
--------------------------------------------------------------------------------

* playback
* mock_helper
* Added show version | include operating mode to list of recorded commands


--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------

* iosxe
* cat9k
* Modified summary.py
* Added reload_confirm_iosxe to reload_to_rommon_statement_list
* Added post time
* Added POST_SWITCHOVER_WAIT before enable


1 change: 1 addition & 0 deletions docs/changelog/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
.. toctree::
:maxdepth: 2

2024/may
2024/april
2024/march
2024/february
Expand Down
51 changes: 51 additions & 0 deletions docs/changelog_plugins/2024/may.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
May 2024
==========

May 28 - Unicon.Plugins v24.5
------------------------



.. csv-table:: Module Versions
:header: "Modules", "Versions"

``unicon.plugins``, v24.5
``unicon``, v24.5

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
--------------------------------------------------------------------------------

* sros
* Updated mdcli regex prompt to accommodate various output

* iosxe
* CAT9K
* Updated regex in Rommon service
* Modified learn_tokens to go to enable mode before sending stop PnP disovery


1 change: 1 addition & 0 deletions docs/changelog_plugins/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Plugins Changelog
.. toctree::
:maxdepth: 2

2024/may
2024/april
2024/march
2024/february
Expand Down
2 changes: 1 addition & 1 deletion src/unicon/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '24.4'
__version__ = '24.5'

supported_chassis = [
'single_rp',
Expand Down
4 changes: 4 additions & 0 deletions src/unicon/plugins/iosxe/cat8k/service_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ def call_service(self, command=None,
timeout=con.connection_timeout,
context=self.context
)

con.log.info(f'Waiting {con.settings.POST_SWITCHOVER_WAIT} seconds before going to enable mode')
sleep(con.settings.POST_SWITCHOVER_WAIT)

con.spawn.sendline()
con.state_machine.go_to(
'enable',
Expand Down
4 changes: 2 additions & 2 deletions src/unicon/plugins/iosxe/cat9k/service_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ def pre_service(self, *args, **kwargs):
con.spawn,
context=self.context)
boot_info = con.execute('show boot')
m = re.search(r'Enable Break = (yes|no)|ENABLE_BREAK variable (= yes|does not exist)', boot_info)
m = re.search(r'Enable Break = (yes|no|0|1)|ENABLE_BREAK variable (= yes|does not exist)', boot_info)
if m:
break_enabled = m.group()
if 'yes' not in break_enabled:
if all(i not in break_enabled for i in ['yes', '1']):
con.configure('boot enable-break')
else:
raise SubCommandFailure('Could not determine if break is enabled, cannot transition to rommon')
Expand Down
3 changes: 2 additions & 1 deletion src/unicon/plugins/iosxe/cat9k/statements.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

from unicon.eal.dialogs import Statement
from unicon.plugins.generic.service_statements import (
save_env, confirm_reset, reload_confirm, reload_confirm_ios)
save_env, confirm_reset, reload_confirm, reload_confirm_ios, reload_confirm_iosxe)

from .patterns import IosXECat9kPatterns

Expand All @@ -20,4 +20,5 @@
confirm_reset,
reload_confirm,
reload_confirm_ios,
reload_confirm_iosxe,
boot_interrupt_stmt]
7 changes: 7 additions & 0 deletions src/unicon/plugins/iosxe/connection_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ def learn_tokens(self):
GenericPatterns().learn_os_prompt)
con.state_machine.add_state(self.learn_tokens_state)

# Change to enable state before sending stop PnP disovery
con.state_machine.go_to('enable',
con.spawn,
context=con.context,
timeout=con.connection_timeout,
prompt_recovery=con.prompt_recovery)

# 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
Expand Down
4 changes: 2 additions & 2 deletions src/unicon/plugins/iosxr/spitfire/service_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,10 @@ def call_service(self,
line_type = line_type[1]

if reload_creds:
context = self.context.copy()
context = con.active.context.copy()
context.update(cred_list=reload_creds)
else:
context = self.context
context = con.active.context

if line_type != 'Console':
raise Exception("Console is not used.")
Expand Down
2 changes: 1 addition & 1 deletion src/unicon/plugins/sros/patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ def __init__(self):
super().__init__()
self.continue_connect = r'Are you sure you want to continue connecting \(yes/no(/\[fingerprint\])?\)'
self.permission_denied = r'^Permission denied, please try again\.\s?$'
self.mdcli_prompt = r'^(.*?)\[.*\][\r\n]+[AB]:.*@%N[#$]\s?$'
self.mdcli_prompt = r'^(.*?)(\[[^\]]*\])?[\r\n]+[AB]:.*@%N[#$]\s?$'
self.classiccli_prompt = r'^(.*?)\*?[AB]:%N(>.*)?[#$]\s?$'
self.discard_uncommitted = r'Discard uncommitted changes\? \[y,n\]'
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,52 @@ cat9k_enable_reload_to_rommon_break2:
"reload":
new_state: cat9k_boot_to_rommon


cat9k_enable_reload_to_rommon_break3:
prompt: "switch1#"
commands:
"show version | include operating mode": ""
"show boot": |
---------------------------
Switch 1
---------------------------
Current Boot Variables:
BOOT variable does not exist
Boot Variables on next reload:
BOOT variable does not exist
Manual Boot = yes
Enable Break = 1
Boot Mode = DEVICE
iPXE Timeout = 0
"config term":
new_state: cat9k_enable_reload_to_rommon_break_config
"reload":
new_state: cat9k_boot_to_rommon


cat9k_enable_reload_to_rommon_break4:
prompt: "switch1#"
commands:
"show version | include operating mode": ""
"show boot": |
---------------------------
Switch 1
---------------------------
Current Boot Variables:
BOOT variable does not exist
Boot Variables on next reload:
BOOT variable does not exist
Manual Boot = yes
Enable Break = 0
Boot Mode = DEVICE
iPXE Timeout = 0
"config term":
new_state: cat9k_enable_reload_to_rommon_break_config
"reload":
new_state: cat9k_boot_to_rommon

cat9k_enable_reload_to_rommon_break_config:
prompt: "%N(config)#"
commands:
Expand Down
111 changes: 110 additions & 1 deletion src/unicon/plugins/tests/mock_data/iosxe/iosxe_mock_data_sdwan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,113 @@ sdwan_config_commit_confirm:
prompt: "Proceed? [yes,no]"
commands:
"yes":
new_state: sdwan_config2
new_state: sdwan_config2

sdwan_controller_mode:
prompt: "%N>"
commands:
"show version | include operating mode": "Router operating mode: Controller-Managed"
"enable":
new_state: sdwan_controller_mode_enable

sdwan_controller_mode_enable:
prompt: "%N#"
commands:
<<: *sdwan_enable_cmds
"show version": |
Cisco IOS XE Software, Version BLD_V1715_THROTTLE_LATEST_20240501_033727_V17_15_0_32
Cisco IOS Software [IOSXE], c8000aep Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Experimental Version 17.15.20240501:040851 [BLD_V1715_THROTTLE_LATEST_20240501_033727:/nobackup/mcpre/s2c-build-ws 102]
Copyright (c) 1986-2024 by Cisco Systems, Inc.
Compiled Tue 30-Apr-24 21:09 by mcpre
Cisco IOS-XE software, Copyright (c) 2005-2024 by cisco Systems, Inc.
All rights reserved. Certain components of Cisco IOS-XE software are
licensed under the GNU General Public License ("GPL") Version 2.0. The
software code licensed under GPL Version 2.0 is free software that comes
with ABSOLUTELY NO WARRANTY. You can redistribute and/or modify such
GPL code under the terms of GPL Version 2.0. For more details, see the
documentation or "License Notice" file accompanying the IOS-XE software,
or the applicable URL provided on the flyer accompanying the IOS-XE
software.
ROM: Encore_V14
Encore uptime is 1 day, 14 hours, 52 minutes
Uptime for this control processor is 1 day, 14 hours, 53 minutes
System returned to ROM by Image Install
System image file is "bootflash:packages.conf"
Last reload reason: Image Install
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.
A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
If you require further assistance please contact us by sending email to
export@cisco.com.
License Mode: Controller-Managed
Smart Licensing Status: Smart Licensing Using Policy
cisco C8530-12X4QC (1EN) processor (revision 1EN) with 14594820K/6147K bytes of memory.
Processor board ID FLX273502YF
Router operating mode: Controller-Managed
12 Ten Gigabit Ethernet interfaces
3 Forty Gigabit Ethernet interfaces
32768K bytes of non-volatile configuration memory.
33554432K bytes of physical memory.
464553984K bytes of NVMe SSD flash at bootflash:.
Configuration register is 0x2102
"show inventory": |
NAME: "Chassis", DESCR: "Cisco C8530-12X4QC Chassis"
PID: C8530-12X4QC , VID: V00 , SN: FLX273502YF
NAME: "Fan Tray", DESCR: "Cisco C8500-FAN-1R Fan Tray"
PID: C8500-FAN-1R , VID: , SN:
NAME: "module 0", DESCR: "Cisco C8530-12X4QC Modular Interface Processor"
PID: C8530-12X4QC , VID: , SN:
NAME: "SPA subslot 0/0", DESCR: "8-port 10/1G SFP Ethernet Port Adapter"
PID: 8xSFP+ , VID: N/A , SN: JAE12345678
NAME: "subslot 0/0 transceiver 0", DESCR: "10GE SR"
PID: SFP-10G-SR-S , VID: V01 , SN: OPM25160UGU
NAME: "subslot 0/0 transceiver 1", DESCR: "10GE SR"
PID: SFP-10G-SR , VID: V03 , SN: AGA15514DWD
NAME: "subslot 0/0 transceiver 2", DESCR: "10GE SR"
PID: SFP-10G-SR-S , VID: V01 , SN: FNS26090JAL
NAME: "subslot 0/0 transceiver 3", DESCR: "10GE SR"
PID: SFP-10G-SR-S , VID: V01 , SN: FNS26090L1M
NAME: "subslot 0/0 transceiver 4", DESCR: "10GE SR"
PID: SFP-10G-SR-S , VID: V01 , SN: FNS26090JAW
NAME: "SPA subslot 0/1", DESCR: "1-port 40/1-port 100/4-port 10 Gigabit QSFP Ethernet Port Adapter"
PID: 4xSFP+/1xQSFP , VID: N/A , SN: JAE12345678
NAME: "SPA subslot 0/2", DESCR: "3-port 40 / 1-port 100 Gigabit QSFP Ethernet Port Adapter"
PID: 3xQSFP , VID: N/A , SN: JAE12345678
NAME: "module R0", DESCR: "Cisco C8530-12X4QC Route Processor"
PID: C8530-12X4QC , VID: V00 , SN: JAE273709CU
NAME: "module F0", DESCR: "Cisco C8530-12X4QC Embedded Services Processor"
PID: C8530-12X4QC , VID: , SN:
"uname -a": ""
"pnpa service discovery stop": ""
10 changes: 9 additions & 1 deletion src/unicon/plugins/tests/mock_data/sros/sros_mock_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ mdcli_execute:
new_state: mdcli_configure_global
"environment console length 512": ""
"environment console width 512": ""
"show port description": |
1/1/c1 QSFP28 Connector
1/1/c1/1 IMO1CRIP002:1/1/c22/1 C00235986 [I]
1/1/c2 QSFP28 Connector
1/1/c2/1 IMO1CRIP002:1/1/c23/1 C00235987 [I]
2024-03-18 17:25:17 WEST
keys:
'ctrl-z': ""
"//":
Expand Down Expand Up @@ -189,4 +196,5 @@ classiccli_config_lag_access:
new_state: classiccli_config_lag
keys:
"ctrl-z":
new_state: classiccli_execute
new_state: classiccli_execute

Loading

0 comments on commit c361060

Please sign in to comment.