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
33 changes: 33 additions & 0 deletions pkgs/clean-pkg/changelog/2025/september.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------

* stages/iosxe
* connect
* Added optional logout argument (default True) to accommodate various scenarios.

* iosxe
* Modified InstallImage
* Added logic to handle ISSU in progress scenario.
* Fixed the logic of InstallRemoveSmu stage and added support to handle uncommitted SMU images

* clean
* IOSXE/cat9k
* Update clean install images to use execute service and pass install timeout.
* IOSXE/cat9k
* Update clean install images to do configure no boot manual on the device.

* iosxe/cat9k/install_image
* Added 'rommon_vars' to install_image stage to support setting rommon variables when booting an image in rommon mode.

* iosxe/install_image
* add image_to_boot to install image

* clean-pkg
* Fix syntax warning
* Added support for matching interfaces by alias in ConfigureInterfaces.

* iosxe/connect
* Removed duplicate configure boot manual in connect stage.


42 changes: 21 additions & 21 deletions pkgs/clean-pkg/sdk_generator/output/github_clean.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkgs/clean-pkg/src/genie/libs/clean/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'''

# metadata
__version__ = "25.8"
__version__ = "25.9"
__author__ = 'Cisco Systems Inc.'
__contact__ = ['[email protected]', '[email protected]']
__copyright__ = 'Copyright (c) 2019, Cisco Systems Inc.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def install_image(self, steps, device, images, save_system_config=SAVE_SYSTEM_CO
loop_continue=True,
continue_timer=False),

Statement(pattern='Press RETURN to get started.*',
Statement(pattern=r'Press RETURN to get started.*',
action='sendline()',
args=None,
loop_continue=False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,10 @@ class InstallImage(IOSXEInstallImage):

post_reload_timeout(int, optional): maximum time before accessing the device after
reload. Default to 60 seconds.

rommon_vars (dict, optional): Dictionary of rommon variables to set during
the reload process. Default: {"DEBUG_CONF": ""}

<Key>: <Value>
Any other arguments that the Unicon reload service supports

Expand All @@ -834,7 +838,10 @@ class InstallImage(IOSXEInstallImage):
'prompt_recovery': True,
'error_pattern': [r"FAILED:.*?$",],
'post_reload_wait': 15,
'post_reload_timeout': 60
'post_reload_timeout': 60,
"rommon_vars": {
"DEBUG_CONF": ""
}
}
ISSU = False
SKIP_BOOT_VARIABLE = False
Expand Down Expand Up @@ -866,6 +873,7 @@ class InstallImage(IOSXEInstallImage):
Optional('error_pattern'): list,
Optional('post_reload_wait'): int,
Optional('post_reload_timeout'):int,
Optional('rommon_vars'): dict,
Any(): Any()
}
}
Expand All @@ -874,16 +882,35 @@ class InstallImage(IOSXEInstallImage):
# Execution order of Stage steps
# ==============================
exec_order = [
'configure_no_boot_manual',
'delete_boot_variable',
'set_boot_variable',
'configure_and_verify_startup_config',
'save_running_config',
'verify_boot_variable',
'check_start_up_config_variables',
'verify_running_image',
'install_image'
]


def check_start_up_config_variables(self, steps, device):
""" Check if debug config is set in rommon variables
"""
with steps.start("Check for debug config in rommon variables") as step:
cmd = 'show romvar'
try:
output = device.parse(cmd)
if debug_conf:=output.get('rommon_variables', {}).get('debug_conf'):
log.info(f"DEBUG_CONF {debug_conf} is set in rommon variables")
self.image_to_boot = "bootflash:packages.conf"
else:
self.image_to_boot = None
log.info("DEBUG_CONF is not set in rommon variables")
except Exception as e:
step.failed("Failed to check for debug config in rommon variables",
from_exception=e)

def install_image(self, steps, device, images,
install_timeout=INSTALL_TIMEOUT,
save_system_config=SAVE_SYSTEM_CONFIG,
Expand Down Expand Up @@ -948,11 +975,12 @@ def _check_for_member_config(spawn, session):
continue_timer=False)
])

install_cmd = 'install add file {} activate commit'
if issu:
device.sendline('install add file {} activate issu commit'.format(images[0]))
else:
device.sendline('install add file {} activate commit'.format(images[0]))
install_cmd = 'install add file {} activate issu commit'

device.sendline(install_cmd.format(images[0]))

try:
dialog.process(device.spawn,
timeout = install_timeout,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,4 @@ def test_iosxe_install_image_skip(self):
"genie.libs.clean.stages.iosxe.cat9k.stages.Dialog.process") as dialog_mock:
dialog_mock.side_effect = Exception
cls.install_image(steps=steps, device=device, images=['sftp://server/image.bin'])
self.assertEqual(Failed, steps.details[0].result)

self.assertEqual(Failed, steps.details[0].result)
Loading