-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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 misuse of 'self' in lib/ansible/module_utils/network/eos/eos.py. … #39074
Fix misuse of 'self' in lib/ansible/module_utils/network/eos/eos.py. … #39074
Conversation
…Method load_config
@@ -232,7 +232,7 @@ def load_config(self, commands, commit=False, replace=False): | |||
|
|||
if not all((bool(use_session), self.supports_sessions)): | |||
if commit: | |||
return self.configure(self, commands) | |||
return self.configure(commands) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is another place where this function is called. Would you mind fixing that also? https://github.com/eakman/ansible/blob/2a22085b2b4af6aa9de4b82311e9586d75611bb9/lib/ansible/module_utils/network/eos/eos.py#L423
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll take a look!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I made the requested changes.
cherry-picked to 2.5 |
ansible#39074) * Fix misuse of 'self' in lib/ansible/module_utils/network/eos/eos.py. Method load_config * Fix all instances of self.config(self,... (cherry picked from commit 80d7e22)
* Handle nxos_feature issue where json isn't supported (#39150) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit 9eff1f1) * Integration Tests only: nxos_snmp_contact (#39318) * add integration test cases for snmp_contact * removing unnecessary files (cherry picked from commit bdb75cd) * fix nxos_ntp issues (#39178) * fix nxos_ntp issues * review comments * fix idempotent fail case (cherry picked from commit 2f99a17) * nxos_interface: AttributeError: 'NoneType' object has no attribute 'group' (#38544) This fixes an issue we recently encounteredi with nxos_interface: ``` Traceback (most recent call last): File "/tmp/ansible_JmLoba/ansible_module_nxos_interface.py", line 777, in main have = map_config_to_obj(want, module) File "/tmp/ansible_JmLoba/ansible_module_nxos_interface.py", line 606, in map_config_to_obj obj['speed'] = re.search(r'speed (\d+)', body).group(1) AttributeError: 'NoneType' object has no attribute 'group' ``` (cherry picked from commit dca6e2d) * fix nxos_snmp_community issues (#39258) (cherry picked from commit 1afec5a) * Add aggregate example in nxos_l2_interface module doc (#39275) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit 86817cd) * Fix misuse of 'self' in lib/ansible/module_utils/network/eos/eos.py. … (#39074) * Fix misuse of 'self' in lib/ansible/module_utils/network/eos/eos.py. Method load_config * Fix all instances of self.config(self,... (cherry picked from commit 80d7e22) * Fix for nxos_snmp_host issues (#39642) * fix snmp_host issues * source files * fix shippable * remove defaults to match arg spec (cherry picked from commit f99bae1) * fix nxos_snmp_traps issues (#39444) * fix snmp_traps code * add IT cases * fix shippable * fix shippable without ignore (cherry picked from commit 99748cb) * changelog Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
ansible#39074) * Fix misuse of 'self' in lib/ansible/module_utils/network/eos/eos.py. Method load_config * Fix all instances of self.config(self,...
ansible#39074) * Fix misuse of 'self' in lib/ansible/module_utils/network/eos/eos.py. Method load_config * Fix all instances of self.config(self,...
ansible#39074) * Fix misuse of 'self' in lib/ansible/module_utils/network/eos/eos.py. Method load_config * Fix all instances of self.config(self,...
Fixes #27630
SUMMARY
There seems to be a slight error in
ansible/lib/ansible/module_utils/network/eos/eos.py
in the methodload_config
.As you can see from the snippet below in the old code, when
configure
is called (an instance method of CLI),self
is given as an argument. This is causing an error (see issue number #27630) becauseconfigure
only takes two arguments. This commit removesself
from the arguments of load_config.Old code:
New code:
ISSUE TYPE
COMPONENT NAME
ansible/lib/ansible/module_utils/network/eos/eos.py
ANSIBLE VERSION
ADDITIONAL INFORMATION