Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XR Clean InstallImagesAndPackages improvement #90

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------
* IOSXR
* Modified:
* Clean Stage:
* InstallImagesAndPackages:
* Enhancement to handle CLI install add/activate in 'synchronous' mode and in standard mode
* Better catch the potential error message when the install is running in the background

15 changes: 12 additions & 3 deletions pkgs/clean-pkg/src/genie/libs/clean/stages/iosxr/stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,13 @@ def update_install_repository(self, steps, device, image,
error_pattern=self.error_patterns)

out = device.expect(
[self.successful_operation_string],
[self.successful_operation_string, self.install_operation_aborted_pattern],
trim_buffer=False,
timeout=install_timeout)
error = re.search(self.install_operation_aborted_pattern, out.match_output)
if error:
device.execute("show install log " + error.groupdict()['id'])
step.failed("The command '{cmd}' aborted ".format(cmd=cmd))
except Exception as e:
step.failed("The command '{cmd}' failed. Error: {e}"
.format(cmd=cmd, e=str(e)))
Expand Down Expand Up @@ -538,9 +542,14 @@ def install_activate(self, steps, device, install_timeout=INSTALL_TIMEOUT):
device.spawn, timeout=install_timeout)

# Wait for successful output
device.expect(
[self.successful_operation_string],
out = device.expect(
[self.successful_operation_string, self.install_operation_aborted_pattern],
trim_buffer=False,
timeout=install_timeout)
error = re.search(self.install_operation_aborted_pattern, out.match_output)
if error:
device.execute("show install log " + error.groupdict()['id'])
step.failed("The command '{cmd}' aborted ".format(cmd=cmd))
except Exception as e:
step.failed("Attempting to activate install id '{id}' "
"failed. Error: {e}"
Expand Down