From f7f760b8d80f7b5585255c7ce44a8ebc6deafa8f Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Mon, 5 Oct 2015 12:47:45 -0500 Subject: [PATCH 1/6] Use ansible-testing project to validate basic module requirements --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index c2583d592fc..466ebc1472d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,12 @@ addons: packages: - python2.4 - python2.6 +install: + - pip install git+https://github.com/ansible/ansible.git@devel#egg=ansible + - pip install git+https://github.com/sivel/ansible-testing.git#egg=ansible_testing script: - python2.4 -m compileall -fq -x 'cloud/|monitoring/zabbix.*\.py|/dnf\.py|/layman\.py|/maven_artifact\.py|clustering/(consul.*|znode)\.py|notification/pushbullet\.py' . - python2.6 -m compileall -fq . - python2.7 -m compileall -fq . + - ansible-validate-modules --exclude 'cloud/amazon/route53_zone\.py|network/snmp_facts\.py|notification/sns\.py|windows/win_iis_virtualdirectory\.py' . #- ./test-docs.sh extras From 0826256e0fa11da839acf9cd1b00c9303fd10140 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Thu, 8 Oct 2015 10:11:19 -0500 Subject: [PATCH 2/6] Remove unneeded spaces at the end of ohai --- system/ohai.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/system/ohai.py b/system/ohai.py index 6f066ec5ad8..d71d581b628 100644 --- a/system/ohai.py +++ b/system/ohai.py @@ -54,5 +54,3 @@ def main(): from ansible.module_utils.basic import * main() - - From 87b0a45a85797dbd88f10f70698683c41b2dde73 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Tue, 22 Dec 2015 15:37:41 -0600 Subject: [PATCH 3/6] Fix tabbed indentation in network/haproxy.py --- network/haproxy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/network/haproxy.py b/network/haproxy.py index 0fb4beb3004..4cc1c1c618b 100644 --- a/network/haproxy.py +++ b/network/haproxy.py @@ -312,9 +312,9 @@ class HAProxy(object): Figure out what you want to do from ansible, and then do it. """ - self.get_current_state(self.host, self.backend) - self.previous_states = ','.join(self.status_server) - self.previous_weights = ','.join(self.status_weight) + self.get_current_state(self.host, self.backend) + self.previous_states = ','.join(self.status_server) + self.previous_weights = ','.join(self.status_weight) # toggle enable/disbale server if self.state == 'enabled': From 4b9388ce9912aedaccce099de5f22c6da176356a Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Tue, 22 Dec 2015 15:38:03 -0600 Subject: [PATCH 4/6] Fix tabbed indentation in packaging/os/pkgutil.py --- packaging/os/pkgutil.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/os/pkgutil.py b/packaging/os/pkgutil.py index cb674b1453c..4307fa6fdac 100644 --- a/packaging/os/pkgutil.py +++ b/packaging/os/pkgutil.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- # (c) 2013, Alexander Winkler -# based on svr4pkg by -# Boyd Adamson (2012) +# based on svr4pkg by +# Boyd Adamson (2012) # # This file is part of Ansible # From 9342bd7c38627a12b17013dcdf445f68172b0d1e Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Tue, 22 Dec 2015 15:38:29 -0600 Subject: [PATCH 5/6] Import module snippets in the correct location --- system/iptables.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/iptables.py b/system/iptables.py index f3ae8da9383..fc6cdb3be5f 100644 --- a/system/iptables.py +++ b/system/iptables.py @@ -18,9 +18,6 @@ # You should have received a copy of the GNU General Public License # along with this software. If not, see . -# import module snippets -from ansible.module_utils.basic import * - BINS = dict( ipv4='iptables', ipv6='ip6tables', @@ -363,5 +360,8 @@ def main(): module.exit_json(**args) +# import module snippets +from ansible.module_utils.basic import * + if __name__ == '__main__': main() From 9645d67fd4b925b83bb95549e53ab5a76ab794a8 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Tue, 22 Dec 2015 15:38:44 -0600 Subject: [PATCH 6/6] Update excludes with currently failing modules --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 466ebc1472d..d61c5743272 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,5 +16,5 @@ script: - python2.4 -m compileall -fq -x 'cloud/|monitoring/zabbix.*\.py|/dnf\.py|/layman\.py|/maven_artifact\.py|clustering/(consul.*|znode)\.py|notification/pushbullet\.py' . - python2.6 -m compileall -fq . - python2.7 -m compileall -fq . - - ansible-validate-modules --exclude 'cloud/amazon/route53_zone\.py|network/snmp_facts\.py|notification/sns\.py|windows/win_iis_virtualdirectory\.py' . + - ansible-validate-modules --exclude 'cloud/amazon/route53_zone\.py|cloud/amazon/sns_topic\.py|messaging/rabbitmq_binding\.py|messaging/rabbitmq_exchange\.py|messaging/rabbitmq_queue\.py|monitoring/circonus_annotation\.py|network/snmp_facts\.py|notification/sns\.py' . #- ./test-docs.sh extras