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

Fix n3k separate to combined image upgrade #37017

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/ansible/modules/network/nxos/nxos_install_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ def parse_show_install(data):
ud['server_error'] = True
elif data == -32603:
ud['server_error'] = True
elif data == 'No install all data found':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikewiebe there is a check on L241 if isinstance(data, int).
From elif data == 'No install all data found:' it looks like data is string. Will the code hit this condition?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Your right that it will never hit this condition. Let me move the check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out this check is not needed. I removed it.

ud['server_error'] = True
return ud
else:
ud['list_data'] = data.split('\n')
Expand Down Expand Up @@ -383,6 +385,7 @@ def build_install_cmd_set(issu, image, kick, type):
else:
commands.append(
'%s system %s kickstart %s' % (rootcmd, image, kick))

return commands


Expand Down Expand Up @@ -452,7 +455,7 @@ def check_mode_nextgen(module, issu, image, kick=None):
# The system may be busy from the previous call to check_mode so loop
# until it's done.
data = check_install_in_progress(module, commands, opts)
if re.search(r'No install all data found', data['raw']):
if data['server_error']:
data['error'] = True
return data

Expand Down