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

get_interfaces_info with AIX #12434

Closed
ulrichSchreiner opened this issue Sep 18, 2015 · 2 comments
Closed

get_interfaces_info with AIX #12434

ulrichSchreiner opened this issue Sep 18, 2015 · 2 comments
Labels
aix AIX community bug This issue/PR relates to a bug. easyfix This issue is considered easy to fix by aspiring contributors. P2 Priority 2 - Issue Blocks Release

Comments

@ulrichSchreiner
Copy link

hi,

i tried to use ansible 1.9.3 from a linux host against a AIX 6.1 host. the previous version worked, but now when gathering facts i get

 ...
  facts = ansible_facts(module)
  File "/var/tmp/ansible-tmp-1442561078.81-20680068205968/setup", line 4432, in ansible_facts facts.update(Network(module).populate())
  File "/var/tmp/ansible-tmp-1442561078.81-20680068205968/setup", line 3692, in populate interfaces, ips = self.get_interfaces_info(ifconfig_path)
TypeError: get_interfaces_info() takes exactly 3 arguments (2 given)

it looks like this commit changed the signature of get_interfaces_info for the AIX platform (now there is a ifconfig_options parameter), but the superclass (GenericBsdIfconfigNetwork) calls this method with only one parameter.

I'm not sure what the correct solution would be. Either set a default value for the parameter with ifconfig_options='a' or change the caller to give an additional parameter (whatever it would be for the GenericBsdIfconfigNetwork).

@Yannig
Copy link
Contributor

Yannig commented Sep 18, 2015

The problem is also present in Ansible v2.

The following patch is doing the trick:

diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py
index ab37177..3d479c6 100644
--- a/lib/ansible/module_utils/facts.py
+++ b/lib/ansible/module_utils/facts.py
@@ -2355,7 +2355,7 @@ class AIXNetwork(GenericBsdIfconfigNetwork, Network):
         return interface['v4'], interface['v6']

     # AIX 'ifconfig -a' does not have three words in the interface line
-    def get_interfaces_info(self, ifconfig_path, ifconfig_options):
+    def get_interfaces_info(self, ifconfig_path, ifconfig_options='-a'):
         interfaces = {}
         current_if = {}
         ips = dict(

Yannig added a commit to Yannig/ansible that referenced this issue Sep 18, 2015
@bcoca bcoca added bug_report P2 Priority 2 - Issue Blocks Release easyfix This issue is considered easy to fix by aspiring contributors. labels Sep 18, 2015
@bcoca bcoca closed this as completed in 1170757 Sep 18, 2015
@ulrichSchreiner
Copy link
Author

Would it be a problem to merge this fix to the latest 1.9? we still have 1.9.2 because this bug is still present in later 1.9-versions.

Upgrade to version2 is planned later this year.

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 6, 2018
@dagwieers dagwieers added the aix AIX community label Jan 8, 2019
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aix AIX community bug This issue/PR relates to a bug. easyfix This issue is considered easy to fix by aspiring contributors. P2 Priority 2 - Issue Blocks Release
Projects
None yet
Development

No branches or pull requests

5 participants