Fix for NameError in cnos.py#39665
Merged
Merged
Conversation
Issue : NameError: global name ‘cnos_devicerules’ is not defined. while running cnos modules. Device Rule file validates the range and type of data going into each CLI based on device type it is executed against. This has to be backported to 2.5
Contributor
gundalow
approved these changes
May 9, 2018
gundalow
pushed a commit
to gundalow/ansible
that referenced
this pull request
May 9, 2018
Issue : NameError: global name ‘cnos_devicerules’ is not defined. while running cnos modules. Device Rule file validates the range and type of data going into each CLI based on device type it is executed against. This has to be backported to 2.5 (cherry picked from commit 3c32b48)
gundalow
added a commit
that referenced
this pull request
May 9, 2018
Issue : NameError: global name ‘cnos_devicerules’ is not defined. while running cnos modules. Device Rule file validates the range and type of data going into each CLI based on device type it is executed against. This has to be backported to 2.5 (cherry picked from commit 3c32b48)
oolongbrothers
pushed a commit
to oolongbrothers/ansible
that referenced
this pull request
May 12, 2018
Issue : NameError: global name ‘cnos_devicerules’ is not defined. while running cnos modules. Device Rule file validates the range and type of data going into each CLI based on device type it is executed against. This has to be backported to 2.5
oolongbrothers
pushed a commit
to oolongbrothers/ansible
that referenced
this pull request
May 14, 2018
Issue : NameError: global name ‘cnos_devicerules’ is not defined. while running cnos modules. Device Rule file validates the range and type of data going into each CLI based on device type it is executed against. This has to be backported to 2.5
oolongbrothers
pushed a commit
to oolongbrothers/ansible
that referenced
this pull request
May 14, 2018
Issue : NameError: global name ‘cnos_devicerules’ is not defined. while running cnos modules. Device Rule file validates the range and type of data going into each CLI based on device type it is executed against. This has to be backported to 2.5
tonal
pushed a commit
to tonal/ansible
that referenced
this pull request
May 15, 2018
Issue : NameError: global name ‘cnos_devicerules’ is not defined. while running cnos modules. Device Rule file validates the range and type of data going into each CLI based on device type it is executed against. This has to be backported to 2.5
oolongbrothers
pushed a commit
to oolongbrothers/ansible
that referenced
this pull request
May 15, 2018
Issue : NameError: global name ‘cnos_devicerules’ is not defined. while running cnos modules. Device Rule file validates the range and type of data going into each CLI based on device type it is executed against. This has to be backported to 2.5
oolongbrothers
pushed a commit
to oolongbrothers/ansible
that referenced
this pull request
May 15, 2018
Issue : NameError: global name ‘cnos_devicerules’ is not defined. while running cnos modules. Device Rule file validates the range and type of data going into each CLI based on device type it is executed against. This has to be backported to 2.5
ilicmilan
pushed a commit
to ilicmilan/ansible
that referenced
this pull request
Nov 7, 2018
Issue : NameError: global name ‘cnos_devicerules’ is not defined. while running cnos modules. Device Rule file validates the range and type of data going into each CLI based on device type it is executed against. This has to be backported to 2.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue : NameError: global name ‘cnos_devicerules’ is not defined. while running cnos modules.
Device Rule file validates the range and type of data going into each CLI based on device type it is executed against.
This has to be backported to 2.5
SUMMARY
While executing the playbooks involving cnos modules, there comes an error where the files cnos_devicerules.py and cnos_errorcodes.py are not available in pythonpath. To mitigate this the change has to be made in import statement.
ISSUE TYPE
COMPONENT NAME
lib/ansible/module_utils/network/cnos/cnos.py
ANSIBLE VERSION
ansible 2.6.0
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible-2.6.0-py2.7.egg/ansible
executable location = /usr/local/bin/ansible
python version = 2.7.6 (default, Nov 23 2017, 15:49:48) [GCC 4.8.4]
ADDITIONAL INFORMATION
This change has to be backported to Ansible 2.5 version as well.