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

Module nxos logging fixes #52883

Merged
merged 3 commits into from
Mar 6, 2019
Merged

Conversation

mikewiebe
Copy link
Contributor

@mikewiebe mikewiebe commented Feb 23, 2019

SUMMARY

This PR fixes the follwing issues:

  • Updates nxapi payloads to use an ordered dictionary to make sure the type and input fields are processed correctly.
    • Order should not matter but some versions of NX-OS software fail to process the payload properly if input gets serialized before type and the payload of input contains the word 'type'.
    • When this happens the command will not be applied to the nxos device.
  • Fixes read_module_context and save_module_context functionality used currently by the nxos_logging module for purge capability. This worked previously for both network_cli and httapi but recent changes to module_utils/nxos.py broke the functionality for httpapi.
  • Fixes an idempotence problem in nxos_logging for logging facilities when attempting to set the logging facility to the default value. The fix checks the playbook setting against the switch default value and does not configure it if it's already in the default state.
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

nxos_logging

Changes tested against a comprehensive matrix of Nexus devices and image versions.

@mikewiebe mikewiebe changed the title Fix nxos logging Module nxos logging fixes Feb 23, 2019
@ansibot
Copy link
Contributor

ansibot commented Feb 23, 2019

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. networking Network category nxos Cisco NXOS community support:network This issue/PR relates to code supported by the Ansible Network Team. labels Feb 23, 2019
@ansibot
Copy link
Contributor

ansibot commented Feb 23, 2019

The test ansible-test sanity --test pylint [explain] failed with 2 errors:

lib/ansible/modules/network/nxos/nxos_logging.py:334:13: too-many-format-args Too many arguments for format string
lib/ansible/modules/network/nxos/nxos_logging.py:335:22: ansible-format-automatic-specification Format string contains automatic field numbering specification

click here for bot help

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Feb 23, 2019
@trishnaguha trishnaguha self-assigned this Feb 25, 2019
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_triage Needs a first human triage before being processed. labels Feb 25, 2019
@dagwieers dagwieers added the cisco Cisco technologies label Feb 27, 2019
@mikewiebe
Copy link
Contributor Author

@Qalthos Any update on this PR? Thanks!

self._module_context = {}

def read_module_context(self, module_key):
if self._module_context.get(module_key):
Copy link
Contributor

Choose a reason for hiding this comment

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

Simply return self._module_context.get(module_key) will do the trick!

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Mar 5, 2019
@Qalthos Qalthos merged commit b090b57 into ansible:devel Mar 6, 2019
@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. cisco Cisco technologies core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. networking Network category nxos Cisco NXOS community stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:network This issue/PR relates to code supported by the Ansible Network Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants