Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions docs/changelog/2025/august.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
August 2025
==========

August 23 - Unicon v25.8
------------------------



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

``unicon.plugins``, v25.8
``unicon``, v25.8




Changelogs
^^^^^^^^^^
--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------

* unicon/bases
* router
* Added a statement to logout dialog to handle the standby console locked
* Added check in designate_handle to skip goto enable when standby is locked


--------------------------------------------------------------------------------
New
--------------------------------------------------------------------------------

* cheetah
* Added cheetah ap tokens in pids csv file

* iosxe/cat9k/9610
* Added the support for stackwise virtual for c9610 devices
* Added SVLStackReload and SVLStackSwitchover services


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

* generic/patterns
* Modified syslog_message_pattern to handle additional syslog message formats.


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

2025/august
2025/july
2025/june
2025/may
Expand Down
38 changes: 38 additions & 0 deletions docs/changelog_plugins/2025/august.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
August 2025
==========

August 23 - Unicon.Plugins v25.8
------------------------



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

``unicon.plugins``, v25.8
``unicon``, v25.8




Changelogs
^^^^^^^^^^
--------------------------------------------------------------------------------
New
--------------------------------------------------------------------------------

* iosxe
* Updated prompts patterns to handle c9800 virtual devices.


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

* iosxe
* Updated syslog pattern to handle security log message

* generic
* Handle tclsh continuation prompt "+>" on initial connection.


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

2025/august
2025/july
2025/june
2025/may
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__ = "25.7"
__version__ = "25.8"

supported_chassis = [
'single_rp',
Expand Down
10 changes: 8 additions & 2 deletions src/unicon/plugins/generic/patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,16 @@ def __init__(self):
# RP/0/0/CPU0:Oct 9 01:44:47.875
# *May 28 09:01:05.136: yang-infra: Default hostkey created (NETCONF_SSH_RSA_KEY.server)
# *May 28 09:01:11.975: PKI_SSL_IPC: SUDI certificate chain and key pair are invalid
# SECURITY WARNING - Module: SSH, Command: crypto key generate rsa ..., Reason: SSH RSA host key uses insufficient key length, Remediation: Configure SSH RSA host key with minimum key length of 3072 bits
# Switch#[OK]
self.syslog_message_pattern = (
r"^.*?(%\w+(-\S+)?-\d+-\w+|"
r"yang-infra:|PKI_SSL_IPC:|Guestshell destroyed successfully|"
r"%Error opening tftp:\/\/255\.255\.255\.255|Autoinstall trying|"
r"audit: kauditd hold queue overflow|"
r"(LC|RP)/\d+/\d+/CPU\d+:\w+\s+\d+\s+\d{2}:\d{2}:\d{2}).*\s*$"
r"audit: kauditd hold queue overflow|SECURITY WARNING|"
r"(LC|RP)/\d+/\d+/CPU\d+:\w+\s+\d+\s+\d{2}:\d{2}:\d{2}|"
r"\[OK\]"
r").*\s*$"
)
self.config_locked = r'Configuration (mode )?(is )?locked|Config mode cannot be entered'

Expand All @@ -99,3 +103,5 @@ def __init__(self):
self.enter_your_encryption_selection_2 = r'^.*?Enter your encryption selection( \[2])?:\s*$'

self.no_password_set = r'^.*% (No password set|Error in authentication.).*'

self.tclsh_continue = r'^\+\>\s?$'
13 changes: 10 additions & 3 deletions src/unicon/plugins/generic/statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def ssh_tacacs_handler(spawn, context):
def password_handler(spawn, context, session):
""" handles password prompt
"""
if 'enable' in spawn.last_sent:
if spawn.last_sent.startswith('enable'):
return enable_password_handler(spawn, context, session)

credential = get_current_credential(context=context, session=session)
Expand Down Expand Up @@ -780,6 +780,13 @@ def __init__(self):
loop_continue=True,
continue_timer=True)

self.tclsh_continue_stmt = Statement(pattern=pat.tclsh_continue,
action="sendline(})",
args=None,
loop_continue=True,
continue_timer=False)


#############################################################
# Statement lists
#############################################################
Expand Down Expand Up @@ -827,7 +834,8 @@ def __init__(self):
initial_statement_list = [generic_statements.init_conf_stmt,
generic_statements.mgmt_setup_stmt,
generic_statements.enter_your_selection_stmt,
generic_statements.enter_your_encryption_selection_stmt
generic_statements.enter_your_encryption_selection_stmt,
generic_statements.tclsh_continue_stmt
]


Expand All @@ -842,4 +850,3 @@ def __init__(self):
authentication_statement_list + \
initial_statement_list + \
pre_connection_statement_list

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
""" A Stackwise-virtual C9610 IOS-XE connection implementation.
"""

from unicon.plugins.iosxe.stack import StackIosXEServiceList
from unicon.plugins.iosxe.stack import IosXEStackRPConnection
from unicon.plugins.iosxe.cat9k.stackwise_virtual.connection_provider import StackwiseVirtualConnectionProvider

from unicon.plugins.iosxe.cat9k.c9500x.stackwise_virtual.service_implementation import SVLStackReload, SVLStackSwitchover


class IosXEC9610StackwiseVirtualServiceList(StackIosXEServiceList):

def __init__(self):
super().__init__()
self.reload = SVLStackReload
self.switchover = SVLStackSwitchover


class IosXEC9610StackwiseVirtualRPConnection(IosXEStackRPConnection):
os = 'iosxe'
platform = 'cat9k'
model = 'c9610'
submodel = 'c9610'
chassis_type = 'stackwise_virtual'
connection_provider_class = StackwiseVirtualConnectionProvider
subcommand_list = IosXEC9610StackwiseVirtualServiceList
4 changes: 2 additions & 2 deletions src/unicon/plugins/iosxe/connection_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def __init__(self, *args, **kwargs):
"""
super().__init__(*args, **kwargs)


def learn_tokens(self):
con = self.connection
if (not con.learn_tokens or not con.settings.LEARN_DEVICE_TOKENS)\
Expand All @@ -32,7 +31,8 @@ def learn_tokens(self):
con.spawn,
context=con.context,
prompt_recovery=con.prompt_recovery)
if con.state_machine.current_state in ['acm', 'config','rules']:

if con.state_machine.current_state in ['acm', 'config', 'rules', 'tclsh']:
con.state_machine.go_to('enable',
con.spawn,
context=con.context,
Expand Down
8 changes: 4 additions & 4 deletions src/unicon/plugins/iosxe/patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ def __init__(self):
self.want_continue_confirm = r'.*Do you want to continue\?\s*\[confirm]\s*$'
self.want_continue_yes = r'.*Do you want to continue\?\s*\[y/n]\?\s*\[yes]:\s*$'
self.disable_prompt = \
r'^(.*?)(\(unlicensed\))?(WLC|Router|RouterRP|Switch|ios|switch|%N)([0-9])?(\(recovery-mode\))?(\(rp-rec-mode\))?(\(standby\))?(-stby)?(-standby)?(\(boot\))?>\s?$'
r'^(.*?)(\(unlicensed\))?(wlc|WLC|Router|RouterRP|Switch|ios|switch|%N)([0-9])?(\(recovery-mode\))?(\(rp-rec-mode\))?(\(standby\))?(-stby)?(-standby)?(\(boot\))?>\s?$'
self.enable_prompt = \
r'^(.*?)(\(unlicensed\))?(WLC|Router|RouterRP|Switch|ios|switch|%N)([0-9])?(\(recovery-mode\))?(\(rp-rec-mode\))?(\(standby\))?(-stby)?(-standby)?(\(boot\))?#[\s\x07]*$'
r'^(.*?)(\(unlicensed\))?(wlc|WLC|Router|RouterRP|Switch|ios|switch|%N)([0-9])?(\(recovery-mode\))?(\(rp-rec-mode\))?(\(standby\))?(-stby)?(-standby)?(\(boot\))?#[\s\x07]*$'
self.maintenance_mode_prompt = \
r'^(.*?)(\(unlicensed\))?(WLC|Router|RouterRP|Switch|ios|switch|%N)([0-9])?(\(standby\))?(-stby)?(-standby)?(\(boot\))?\(maint-mode\)#[\s\x07]*$'
r'^(.*?)(\(unlicensed\))?(wlc|WLC|Router|RouterRP|Switch|ios|switch|%N)([0-9])?(\(standby\))?(-stby)?(-standby)?(\(boot\))?\(maint-mode\)#[\s\x07]*$'
self.press_enter = ReloadPatterns().press_enter
self.config_prompt = r'^(.*)\((?!.*pki-hexmode).*(con|cfg|ipsec-profile|ca-trustpoint|ca-certificate-map|cs-server|ca-profile|gkm-local-server|cloud|host-list|config-gkm-group|gkm-sa-ipsec|gdoi-coop-ks-config|wsma|enforce-rule|DDNS|ca-trustpool|cert-trustpool)\S*\)#\s?$'

Expand Down Expand Up @@ -56,7 +56,7 @@ def __init__(self):
self.useracess = r'^.*User Access Verification'
self.setup_dialog = r'^.*(initial|basic) configuration dialog.*\s?'
self.autoinstall_dialog = r'^(.*)Would you like to terminate autoinstall\? ?\[yes\]: $'
self.default_prompts = r'^(.*?)(WLC|Router|RouterRP|Switch|ios|switch|.*)([0-9])?(\(standby\))?(\(boot\))?(>|#)'
self.default_prompts = r'^(.*?)(wlc|WLC|Router|RouterRP|Switch|ios|switch|.*)([0-9])?(\(standby\))?(\(boot\))?(>|#)'
self.telnet_prompt = r'^.*telnet>\s?'
self.please_reset = r'^(.*)Please reset'
self.grub_prompt = r'.*The highlighted entry will be (booted|executed) automatically in .*?(\x1b\S+)?\s+'
Expand Down
72 changes: 71 additions & 1 deletion src/unicon/plugins/pid_tokens.csv
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,48 @@ pid,os,platform,model,submodel
8808,iosxr,spitfire,8800,
8812,iosxr,spitfire,8800,
8818,iosxr,spitfire,8800,
AIR-AP1832I-B-K9,cheetah,ap,air1800,
AIR-AP1832I-C-K9,cheetah,ap,air1800,
AIR-AP1832I-D-K9,cheetah,ap,air1800,
AIR-AP1832I-E-K9,cheetah,ap,air1800,
AIR-AP1832I-F-K9,cheetah,ap,air1800,
AIR-AP1852E-B-K9,cheetah,ap,air1800,
AIR-AP1852E-C-K9,cheetah,ap,air1800,
AIR-AP1852E-D-K9,cheetah,ap,air1800,
AIR-AP1852E-F-K9,cheetah,ap,air1800,
AIR-AP1852E-K-K9,cheetah,ap,air1800,
AIR-AP1852I-B-K9,cheetah,ap,air1800,
AIR-AP1852I-C-K9,cheetah,ap,air1800,
AIR-AP1852I-D-K9,cheetah,ap,air1800,
AIR-AP2802E-A-K9,cheetah,ap,air2800,
AIR-AP2802E-B-K9,cheetah,ap,air2800,
AIR-AP2802E-D-K9,cheetah,ap,air2800,
AIR-AP2802E-F-K9,cheetah,ap,air2800,
AIR-AP2802E-K-K9,cheetah,ap,air2800,
AIR-AP2802I-A-K9,cheetah,ap,air2800,
AIR-AP2802I-B-K9,cheetah,ap,air2800,
AIR-AP2802I-C-K9,cheetah,ap,air2800,
AIR-AP2802I-D-K9,cheetah,ap,air2800,
AIR-AP2802I-E-K9,cheetah,ap,air2800,
AIR-AP2802I-F-K9,cheetah,ap,air2800,
AIR-AP2802I-K-K9,cheetah,ap,air2800,
AIR-AP3802E-A-K9,cheetah,ap,air3800,
AIR-AP3802E-B-K9,cheetah,ap,air3800,
AIR-AP3802E-D-K9,cheetah,ap,air3800,
AIR-AP3802E-F-K9,cheetah,ap,air3800,
AIR-AP3802E-K-K9,cheetah,ap,air3800,
AIR-AP3802I-A-K9,cheetah,ap,air3800,
AIR-AP3802I-B-K9,cheetah,ap,air3800,
AIR-AP3802I-C-K9,cheetah,ap,air3800,
AIR-AP3802I-D-K9,cheetah,ap,air3800,
AIR-AP3802I-E-K9,cheetah,ap,air3800,
AIR-AP3802I-F-K9,cheetah,ap,air3800,
AIR-AP3802I-K-K9,cheetah,ap,air3800,
AIR-AP4800-B-K9,cheetah,ap,air4800,
AIR-AP4800-D-K9,cheetah,ap,air4800,
AIR-AP4800-E-K9,cheetah,ap,air4800,
AIR-AP4800-F-K9,cheetah,ap,air4800,
AIR-AP4800-K-K9,cheetah,ap,air4800,
AS2511-RJ,ios,c2500,c2511,
ASR-9001,iosxr,asr9k,asr9000,
ASR-9001-S,iosxr,asr9k,asr9000,
Expand Down Expand Up @@ -391,6 +433,11 @@ C9130AXI-R,cheetah,ap,c9100ap,
C9130AXI-S,cheetah,ap,c9100ap,
C9130AXI-T,cheetah,ap,c9100ap,
C9130AXI-Z,cheetah,ap,c9100ap,
C9136I-B,cheetah,ap,c9100ap,
C9136I-D,cheetah,ap,c9100ap,
C9136I-E,cheetah,ap,c9100ap,
C9136I-F,cheetah,ap,c9100ap,
C9136I-K,cheetah,ap,c9100ap,
C9200-24P,iosxe,cat9k,c9200,
C9200-24PB,iosxe,cat9k,c9200,
C9200-24PXG,iosxe,cat9k,c9200,
Expand Down Expand Up @@ -637,6 +684,29 @@ CISCO7613-S,ios,c7k,c7600,
CR-4430-B,iosxe,c4k,c4400,
CR-4430-K9,iosxe,c4k,c4400,
CR-4450-ICDN-K9,iosxe,c4k,c4400,
CW9162I-B,cheetah,ap,cw9100,
CW9162I-D,cheetah,ap,cw9100,
CW9162I-E,cheetah,ap,cw9100,
CW9162I-F,cheetah,ap,cw9100,
CW9162I-K,cheetah,ap,cw9100,
CW9164I-B,cheetah,ap,cw9100,
CW9164I-D,cheetah,ap,cw9100,
CW9164I-E,cheetah,ap,cw9100,
CW9164I-F,cheetah,ap,cw9100,
CW9164I-K,cheetah,ap,cw9100,
CW9164I-ROW,cheetah,ap,cw9100,
CW9166D1-B,cheetah,ap,cw9100,
CW9166D1-D,cheetah,ap,cw9100,
CW9166D1-E,cheetah,ap,cw9100,
CW9166D1-F,cheetah,ap,cw9100,
CW9166D1-K,cheetah,ap,cw9100,
CW9166I-B,cheetah,ap,cw9100,
CW9166I-D,cheetah,ap,cw9100,
CW9166I-E,cheetah,ap,cw9100,
CW9166I-F,cheetah,ap,cw9100,
CW9166I-K,cheetah,ap,cw9100,
CW9176I,cheetah,ap,cw9100,
CW9178I,cheetah,ap,cw9100,
IE-3200-8P2S-E,iosxe,ie3k,ie3200,
IE-3200-8T2S-E,iosxe,ie3k,ie3200,
IE-3300-8P2S-A,iosxe,ie3k,ie3300,
Expand Down Expand Up @@ -1441,4 +1511,4 @@ WS-C6509-NEB-A,iosxe,cat6k,c6500,
WS-C6509-V-E,iosxe,cat6k,c6500,
WS-C6513,iosxe,cat6k,c6500,
WS-C6513-E,iosxe,cat6k,c6500,
WS-X3011-CH,iosxe,cat3k,c3000,
WS-X3011-CH,iosxe,cat3k,c3000,
37 changes: 37 additions & 0 deletions src/unicon/plugins/tests/mock_data/iosxe/iosxe_mock_cat9k.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,36 @@ c9k_enable:
new_state: c9k_enable_quick_reload
"reload":
new_state: c9k_reload_proceed
"show startup-config":
response: |
Building configuration...

Current configuration : 5073 bytes

!

! Last configuration change at 14:22:51 UTC Mon Jul 14 2025

!

version 17.18

service timestamps debug datetime msec

service timestamps log datetime msec

service internal

!

hostname Switch

!

!
end
new_state:
log_message_2
"show version | include operating mode" : ""
"show version" :
response: |
Expand Down Expand Up @@ -184,6 +214,13 @@ log_message:
"":
new_state: c9k_enable

log_message_2:
preface: "Switch#[OK]"
prompt: ""
commands:
"":
new_state: c9k_enable


c9k_login2:
preface: |
Expand Down
Loading
Loading