Commit graph

672 commits

Author SHA1 Message Date
Sébastien DA ROCHA
bc4ba6b638 Iptables unit tests (#30762)
* Add some tests for iptables

* Fix remove bug (calls 2 times check to remove a chain)

* Add me as maintainer

* Fix PEP8

* Doc: Give more information on issue #18988

* Fix #18988 and test it

* Fix doc (thanks Pillou)

* enable PEP8 check for iptables
2017-11-01 12:08:57 +01:00
Tim Rupp
fc4580b4cc
Removes bigip ssl certificate from skip file (#32424) 2017-10-31 21:17:07 -07:00
Tim Rupp
6193d5bc65
Removes gtm wide ip from skip file (#32422) 2017-10-31 20:45:42 -07:00
Tim Rupp
8868b5fa85
Removes gtm pool from skip file (#32419) 2017-10-31 20:12:53 -07:00
Tim Rupp
daaf8ca86c
Fixes skip imports for bigip_configsync_action module (#32413) 2017-10-31 19:22:36 -07:00
Tim Rupp
8f2b243a3e
Fixes bigip_config to remove from skip file (#32409) 2017-10-31 15:48:23 -07:00
Tim Rupp
8c5cd9c530
Removes bigip_command from the skip file (#32407)
Includes fixes and enhancements to make it unnecessary to include this
module in the skip file
2017-10-31 13:50:28 -07:00
Satyajit Bulage
52aa522c19 google: PEP8 compliancy fixes (#32309)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes

Signed-off-by: Satyajit Bulage <sbulage@redhat.com>
2017-10-31 10:53:31 +01:00
nilhase25
1a43038bc2 Pep8 aos login.py (#32312)
* fix pep8 issue in consul_kv.py

* fix pep8 issue in aos_login.py
2017-10-30 21:56:34 +05:30
nilhase25
9cff2c376b fix pep8 issue in consul_kv.py (#32310) 2017-10-30 11:37:52 +01:00
Dag Wieers
005c1ce7ba
Sort the PEP8 legacy files (#32339) 2017-10-30 10:36:47 +01:00
Dag Wieers
16bbc19674
subversion: PEP8 compliancy and doc fixes (#30909)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-10-30 01:09:00 +01:00
Dag Wieers
86bb82a220
user: PEP8 compliancy and doc fixes (#30895)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-10-30 01:06:37 +01:00
Dag Wieers
63edeb1644
systemd: PEP8 compliancy and doc fixes (#30892)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-10-30 01:04:57 +01:00
Dag Wieers
8b2bf09c49
service: PEP8 compliancy and doc fixes (#30890)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-10-30 01:03:54 +01:00
Dag Wieers
edc0ff481c
seboolean: PEP8 compliancy and doc fixes (#30888)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-10-30 01:02:45 +01:00
Dag Wieers
32775b0caa
hostname: PEP8 compliancy and doc fixes (#30886)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-10-30 01:00:49 +01:00
Dag Wieers
3ae42afbc7
getent: PEP8 compliancy and doc fixes (#30885)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-10-30 00:58:04 +01:00
Dag Wieers
11f8d9659d
at: PEP8 compliancy and doc fixes (#30881)
This PR includes:
- PEP8 compliancy fixes
- Documentation changes
2017-10-30 00:56:54 +01:00
Dag Wieers
c46401e41f
tempfile: PEP8 compliancy, pylint and docs (#30859)
This PR includes;
- PEP8 compliancy fixes
- pylint fixes
- Documentation updates
2017-10-30 00:51:19 +01:00
Dag Wieers
f64a8f58a3
synchronize: PEP8 compliancy, pylint and docs (#30858)
This PR includes;
- PEP8 compliancy fixes
- pylint fixes
- Documentation updates
2017-10-30 00:49:47 +01:00
Dag Wieers
19c3c7fe44
blockinfile: PEP8 compliancy, pylint and docs (#30845)
This PR includes;
- PEP8 compliancy fixes
- pylint fixes
- Documentation updates
2017-10-30 00:43:18 +01:00
Dag Wieers
fb18e27d87
assemble: PEP8 compliancy, pylint and docs (#30844)
This PR includes;
- PEP8 compliancy fixes
- pylint fixes
- Documentation updates
2017-10-30 00:41:47 +01:00
Dag Wieers
0129b96065
archive: PEP8 compliancy, pylint and docs (#30842)
This PR includes;
- PEP8 compliancy fixes
- pylint fixes
- Documentation updates
2017-10-30 00:39:30 +01:00
Aniket Khisti
27694f6909 PEP8 compliancy for os_server_volume module (#32306) 2017-10-29 14:15:32 +05:30
Sloane Hertel
c714da7fac cloudformation_facts: don't fail on nonexistent stack - fixes #23419 (#23758)
* Allow cloudformation_facts to exit gracefully if stack does not exist

make cloudformation_facts pep8

remove from legacy files

remove unnecessary if statement

Allow cloudformation_facts to exit gracefully if stack does not exist version 2

fix documentation errors

add an example for a hard-fail if a stack doesn't exist

* Remove extra whitespace

* Use the .response attribute since .message isn't present with Python 3

* Don't fail if no stack name is provided and no stacks exist.
2017-10-26 15:18:31 -04:00
Matt Clay
cf1337ca9a Update ansible-test sanity command. (#31958)
* Use correct pip version in ansible-test.
* Add git fallback for validate-modules.
* Run sanity tests in a docker container.
* Use correct python version for sanity tests.
* Pin docker completion images and add default.
* Split pylint execution into multiple contexts.
* Only test .py files in use-argspec-type-path test.
* Accept identical python interpeter name or binary.
* Switch cloud tests to default container.
* Remove unused extras from pip install.
* Filter out empty pip commands.
* Don't force running of pip list.
* Support delegation for windows and network tests.
* Fix ansible-test python version usage.
* Fix ansible-test python version skipping.
* Use absolute path for log in ansible-test.
* Run vyos_command test on python 3.
* Fix windows/network instance persistence.
* Add `test/cache` dir to classification.
* Enable more python versions for network tests.
* Fix cs_router test.
2017-10-26 00:21:46 -07:00
Daniel Shepherd
8aeb239f73 [cloud] Update ec2_vpc_net_facts to use Boto3 (#25375)
* update ec2_vpc_net_facts module to boto3

updated with RETURN values and other requested changes

removed errant extra blank line

another errant extra line removed...auto-linter not working apparently

updates per review

fix typo in RETURN docs

* fix trailing whitespace issue
2017-10-25 13:26:16 -04:00
Matt Davis
0c34cdd0f7 fix #Requires to be valid in real Powershell (#31858)
* module_utils #Requires should not have .psm1 extension if "real" Powershell will ever execute them
* updated validate-modules to enforce this
* added check to disallow multi-module syntax on Ansible.ModuleUtils #Requires
2017-10-23 11:40:54 -07:00
Tim Rupp
8085c38e05 Refactors the bigip_gtm_facts module (#31917)
Includes pep fixes and inlining code with current conventions
2017-10-20 18:05:45 -07:00
Matt Clay
36b13e3e3d Fix ansible-test default image. (#31966)
* Add openssh-client to default docker container.
* Include Azure requirements in default container.

To do so, handling of pip requirements was updated to install each
set of requirements separately and then run a verification pass to
make sure there are no conflicts between requirements.

* Add missing --docker-no-pull option.
* Add documentation for the azure-requirements test.
2017-10-20 08:48:01 -07:00
Matt Clay
f76afab6e5 Add new default Docker container for ansible-test. (#31944)
* Add new default Docker container for ansible-test.
* Update ansible-test change classification.
* Update list of disabled pylint rules.
* Fix pylint issues with ansible-test.
2017-10-19 13:37:22 -07:00
Matt Clay
6c3339402a Improve python 2/3 ABC fallback for pylint. (#31848)
* Improve python 2/3 ABC fallback for pylint.
* Allow longer method names in ansible-test.
2017-10-17 12:49:10 -07:00
Matt Clay
f012c94fa5 Handle bad options syntax in validate-modules. 2017-10-16 11:38:14 -07:00
Eike Frost
1b71fb0499 fix legacy PEP8 violations in zabbix modules, remove test exception for them (#31702)
* fix legacy PEP8 violations in zabbix_*, remove test exception for them

* fix new pep8 violations for zabbix_maintenance.py
2017-10-16 19:20:54 +02:00
René Moser
8b8d5aaca7 cs_instance: remove CloudStackException dep (#31724)
- fixes dep
- fix docs
2017-10-14 00:09:57 +02:00
Pilou
840a57a4ed s3_sync: fix broken import (#31460) 2017-10-12 20:48:05 +02:00
Abhijeet Kasurde
9d811a34c4 pep8 fixes for vmware modules (#31537)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-10-12 07:50:05 +02:00
René Moser
540d53327d cs_instance_facts: fix pep8 (#31606) 2017-10-12 14:00:14 +10:00
Toshio Kuratomi
f38b8d9997 Remove boundary_meter module as the hosted service it configured has been removed. (#31506)
References #29387
2017-10-12 09:12:37 +10:00
René Moser
e872763877 cs_portforward: remove CloudStackException dep (#31610)
- fixes pep8
- fixes doc
2017-10-12 00:25:01 +02:00
René Moser
c1121dd5fb cs_securitygroup_rule: remove CloudStackException dependency (#31603)
- fixes pep8
- fixes docs
2017-10-11 22:23:00 +02:00
René Moser
af6e89fbc8 cs_securitygroup: remove CloudStackException dep (#31597)
- fixes pep8
- fixes docs
2017-10-11 20:58:08 +02:00
Rene Moser
d6e1f02990 cs_snapshot_policy: remove CloudStackException dependency 2017-10-11 18:35:54 +02:00
Toshio Kuratomi
b454115e9f Update test cases
* Remove cloudstack, f5, and nxos from the wildcard import whitelist
* Remove nxos and f5 from the get_exception whitelist
* Remove some files from the pep8 legacy whitelist
2017-10-09 21:41:02 -07:00
Toshio Kuratomi
c81314dcb9 Add a hack to test whether type=path should be used in a module 2017-10-09 21:15:56 -07:00
Toshio Kuratomi
5e9384300d Add boilerplate and remove wildcard imports for openstack modules (#31461)
* Add boilerplate and remove wildcard imports for openstack modules
* Remove openstack files that are now pep8 compliant from the legacy list
2017-10-09 09:56:26 -07:00
Sofiane Medjkoune
ef72eda172 Adding doc for the description argument of lxd_profile module 2017-10-09 11:11:58 -04:00
Toshio Kuratomi
9c81257ce3 Remove wildcard imports from amazon modules (#31451)
* Remove wildcard imports from amazon modules
* Remove files from legacy pep8 that now pass
2017-10-09 07:38:41 -07:00
Pilou
870974e0be ec2_vpc_route_table: fix broken import (#31459) 2017-10-09 20:20:31 +10:00
Pilou
0be8ac6797 ec2_vpc_igw: fix broken import (#31458) 2017-10-09 15:36:12 +10:00
Dag Wieers
ae5d8e5ebb modprobe: PEP8 compliancy and doc fixes (#31255)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
- Make module a bit more consistent with existing practices
2017-10-08 09:21:58 -04:00
Matt Clay
a333f2e5b0 Fix ansible-test config management. 2017-10-04 12:52:36 -07:00
Dag Wieers
17fbeeb2f0 rhn_channel: PEP8 compliancy and doc fixes (#30912)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-10-03 09:50:44 +02:00
Dag Wieers
4a358b5396 foreman: PEP8 compliancy and doc fixes (#30910)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-10-03 09:50:27 +02:00
Pilou
44f5b2bd25 ansible_tower: fix broken import, reuse tower_argument_spec and documentation fragment (#29115)
* module_utils/ansible_tower: fix broken import

* tower_*: use tower_argument_spec & doc fragment

* tower doc fragment: Ansible requires Python 2.6+

* tower_job_wait: fix broken import (Py3 compat)
2017-10-02 16:21:24 -04:00
Dag Wieers
1241d0a3f4 pip: PEP8 compliancy and doc fixes
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-10-02 16:18:56 -04:00
Dag Wieers
bedfd0a5a4 atomic: PEP8 compliancy and doc fixes (#30918)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-09-29 13:17:29 +02:00
Rene Moser
d7fa3ab487 cloudstack: cs_template: remove dependency to CloudStackException
* fixes docs
* fixes pep8
2017-09-29 11:11:22 +02:00
Dag Wieers
fde4244d04 kubernetes: PEP8 compliancy and doc fixes (#30914)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-09-29 01:51:23 -04:00
Dag Wieers
0ef87c849f virt: PEP8 compliancy and doc fixes (#30917)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-09-27 22:37:54 -04:00
René Moser
b444332412 fix pep8 for cloudscale_server (#30974) 2017-09-27 11:39:02 -04:00
Dag Wieers
fd91da7297 pacman: PEP8 compliancy and doc fixes (#30913)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-09-27 03:13:18 -04:00
Dag Wieers
91bb211922 redis: PEP8 compliancy and doc fixes (#30920)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-09-27 02:12:06 -04:00
Dag Wieers
125c4b135d mount: PEP8 compliancy and doc fixes
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-09-27 01:56:08 +02:00
Will Thames
ce2f5d26ab Improve cloudwatchevent_rule exception handling (#30823)
* Fix cloudwatchevent_rule exception handling

Where it is currently present, this change fixes the exception handling.
However, there are many places that it is lacking.

Fixes #30806

* Add new exception handling for cloudwatchevent_rule

Ensure all API calls are wrapped with exception handling

* PEP8 tidy up

* Remove unnecessary HAS_BOTO3 import and checks

Tidy up documentation so that NO_QA can be removed
2017-09-26 12:47:24 -04:00
Dag Wieers
c3707aaf37 linode: PEP8 compliancy and doc fixes (#30922)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-09-26 09:48:08 -04:00
Dag Wieers
4647713be9 cron: PEP8 compliancy and doc fixes (#30884)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-09-25 19:48:22 -04:00
Dag Wieers
5175bd8ebd replace: PEP8 compliancy, pylint and docs (#30856)
This PR includes;
- PEP8 compliancy fixes
- pylint fixes
- Documentation updates
2017-09-25 17:55:45 -04:00
Dag Wieers
989bd1f829 xattr: PEP8 compliancy, pylint and docs (#30861)
This PR includes;
- PEP8 compliancy fixes
- pylint fixes
- Documentation updates
2017-09-25 12:21:18 -04:00
Dag Wieers
04b5c17578 ini_file: PEP8 compliancy, pylint and docs (#30851)
This PR includes;
- PEP8 compliancy fixes
- pylint fixes
- Documentation updates
2017-09-25 11:39:46 -04:00
Hervé Beraud
0e9ae5b8cc [fix] no-unicode-literals sanity error on ansible.egg-info (#30446)
* [fix] no-unicode-literals sanity error on ansible.egg-info
2017-09-21 12:47:24 -07:00
Toshio Kuratomi
46e5c48f03 Split ec2_elb_* modules in service of rename/interface changes (#30532)
* Undeprecate ec2_elb_*
* Make ec2_elb* full fledged modules rather than aliases
* Split tests for ec2_elb_lb and elb_classicb_lb
* Change names in documentation of old and new elb modules

Add tests for ec2_elb_lb
2017-09-21 13:06:14 -04:00
Dag Wieers
f5dded59c2 mail: Fix charset encoding issue
This PR includes:
- An important fix to charset encoding of from address
- Documentation and examples cleanup
- PEP8 fixes
- Warning on insecure access
- Strict parameter typing
- More modern interface (using lists rather than comma, space or pipe-delimited strings)
- Warn on failure to send mail to some recipients
  ```
   [WARNING]: Failed to send mail to 'foobar': 550 5.1.1 <foobar>:
Recipient address rejected: User unknown in local recipient table
  ```
- Warn on failure to parse some headers
  ```
  [WARNING]: Skipping header 'Foobar', unable to parse
  ```
- Return failed recipients as return value
- Changed default encoding to utf-8
2017-09-21 01:07:53 +02:00
Matt Clay
dbf9634b1b Enable more pylint rules and fix reported issues. (#30543)
* Enable pylint invalid-encoded-data test.
* Enable pylint anomalous-unicode-escape-in-string test.
2017-09-19 00:45:35 -07:00
Matt Clay
7714dcd04e Enable more pylint rules and fix reported issues. (#30539)
* Enable pylint unreachable test.
* Enable pylint suppressed-message test.
* Enable pylint redundant-unittest-assert test.
* Enable pylint bad-open-mode test.
* Enable pylint signature-differs test.
* Enable pylint unnecessary-pass test.
* Enable pylint unnecessary-lambda test.
* Enable pylint raising-bad-type test.
* Enable pylint logging-not-lazy test.
* Enable pylint logging-format-interpolation test.
* Enable pylint useless-else-on-loop test.
2017-09-18 23:20:32 -07:00
Toshio Kuratomi
c82cf791dd Add a code-smell test for smart quotes and remove smart quotes from all files 2017-09-18 16:49:16 -07:00
Matt Davis
6b5b465125 azure_rm_dnsrecordset rewrite (#30449)
As-merged, had several issues that prevented idempotent usage. Some args were defined at the wrong UI level. Dual-state args didn't match up with typical Ansible UI.
2017-09-15 18:12:46 -07:00
René Moser
f128796782 cs_volume: fix CloudStackException dependency (#30389)
fixes pep8
2017-09-15 20:40:28 +02:00
Pierre-Louis Bonicoli
e9d202f944 module_utils/avi.py: fix broken import 2017-09-14 10:59:25 -07:00
Nathaniel Case
8c03609e54 nxos_snmp cleanup (#28922)
* Clean up nxos_snmp_contact & nxos_snmp_location

* Bring nxos_snmp_community in line

* Bring nxos_snmp_host in line

* And I would have gotten away with it too,

if it weren't for those meddling sanity tests

* Bring nxos_snmp_traps & nxos_snmp_user in line

* Appease Shippable
2017-09-13 08:23:36 -07:00
Matt Clay
442af3744e Miscellaneous pylint fixes.
The following rules are no longer disabled:

- bad-format-string
- duplicate-key
- lost-exception
- trailing-newlines
- unexpected-keyword-arg
- useless-suppression
- using-constant-test
2017-09-13 01:53:08 -07:00
John R Barker
bc2f4365b5 Correctly validate module name for modules with aliases (#29957)
* Correctly validate module name for modules with aliases

If a module has an alias (ie is a symlink) then we need to ensure that
DOCUMENTATION.module is set to the main name, not the aliased name

* formatting
2017-09-12 13:30:49 +01:00
Matt Clay
68aeaa58a8 Fix dangerous default args. (#29839) 2017-09-12 00:11:13 -07:00
Matt Clay
79bc49e150 Fix ansible-test unicode and sanity tests. (#29743)
* Show warning when using pylint on Python 2.6.
* Add pylint disable entries for Python 2.
* Fix unicode handling in ansible-test.
* Add missing documentation.
2017-09-11 16:39:34 -07:00
Abhijeet Kasurde
b5eca624d0 Refactor easy_install module
* PEP8 fix
* Rectified string check in package install command stdout
* Add abadger's code review changes

Fixes #22245

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-09-11 15:45:41 -07:00
Adam Miller
75127092f2 refactor firewalld module with object abstraction (#26487)
* refactor firewalld module with object abstraction

This change creates a FirewallTransaction object that each
individual transaction type is a sub-class of as they all follow the
same pattern to enable or disable something in the firewall.

Also, there's a few bugfixes here:
    - Fix the "source" type to handle permanent operations
    - Remove ambiguity of required parameters for only specific use
      cases that can lead to transactions effectively being a no-op.
      Instead, pick sane defaults and document them.
    - Change how imports are done so globals are no longer needed

This is based on the original feedback by Toshio from the last
refactor attempt:

    https://github.com/ansible/ansible-modules-extras/pull/3383

Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>

* fix line too long for pep8 for shippable tests

Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>

* remove firewalld from pep8/legacy-files

Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>
2017-09-11 14:10:07 -07:00
Toshio Kuratomi
ff13d58c14 Remove use of unicode_literals as it is an anti-pattern
from __future__ unicode_literals leads to developer confusion as
developers no longer can tell whether a bare literal string is a byte
string or a unicode string.  Explicit marking as u"" or b"" is the way
to solve the same problem in the Ansbile codebase.
2017-09-11 13:33:51 -07:00
Matt Clay
5953a428a8 Undo accidental addition to skip.txt. 2017-09-11 09:45:44 -07:00
Matt Clay
cafd064547 Improve import error handling in azure_rm_common. (#29153)
* Improve import error handling in azure_rm_common.

* Update skip.txt
2017-09-11 09:11:28 -07:00
Matt Clay
f88750d665 Expand disabled pylint rules. (#29162)
* Expand disabled pylint rules.
* Fix pylint and unicode issues in ansible-test.
2017-09-09 08:59:09 -07:00
Pierre-Louis Bonicoli
557356c571 module_utils/ovirt.py: fix broken import 2017-09-08 22:12:00 -07:00
Matt Clay
e71cddc026 Remove unnecessary import skip entries. 2017-09-08 11:27:58 -07:00
Sam Doran
a5ee865634 Update elasticsearch_plugin.py (#28936)
* Update elasticsearch_plugin.py

Change module to work with Elasticsearch 2.x and 5.x automatically.
Update examples and docs.
Supersedes #21989

* Check system paths for elasticsearch-plugin binary

Use get_bin_path from basic.py for searching paths.

* Create a copy of PLUGIN_BIN_PATHS rather than modifying the global

* Use provided plugin_bin path first before trying other places

Change global PLUGIN_BIN_PATHS to a tuple
2017-09-07 11:33:53 -04:00
Abhijeet Kasurde
dd9db65a9a PEP8 fixes for smartos module
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-08-30 12:53:50 -07:00
pari-
468e71bf71 npm: fix idempotence (#22238)
* npm: fix idempotence

* Better idempotency fix

More intelligently add --production rather than depending on hard coded order in args list
Cleanup boilderplate imports and license
PEP8 fixes
2017-08-28 17:26:01 -04:00
Michael De La Rue
fbec5ab12d [cloud] new module lambda_policy (PR #24951)
- Fixes to lambda
- reformatting + tests for lambda_facts
- lambda module integration test
- switch lambda and lambda_facts to AnsibleAwsModule
- Get the account ID from STS, GetUser, and finally error message
2017-08-28 16:45:53 -04:00
Will Thames
63df0adc17 [cloud] Update RDS parameter group for boto3 (#25345)
* Update RDS parameter group for boto3

* Update to boto3
* Update to latest ansible standards
* Remove choices list for valid engines (See #19221 for context)
* Allow tagging
* Return some useful information, and document that information

* Add tests for rds_param_group

* Improve testing of rds_param_group

* Add purge_tags option for rds_param_group

* Fix remaining broken rds_param_group tests

* Ensure the group name is lowercased. Fixes integration tests when run on OSX
2017-08-28 12:52:22 -04:00
Dag Wieers
a1876bac9c pkg5_publisher: Fix on failed, PEP8 compliancy (#26019) 2017-08-27 00:30:05 +02:00
George Nikolopoulos
869eee0762 Deprecate citrix/netscaler module (#28280)
* Deprecate citrix/netscaler module

* 	renamed:    netscaler.py -> _netscaler.py

* Fix legacy files list
2017-08-25 13:51:15 -04:00
Will Thames
b1df75fc1c [cloud] Return AMI info on ec2_ami module when changed=false (#27867)
Fixes #27861
2017-08-23 12:01:49 -04:00
Tomáš Karásek
b3a90253fc Improvements in the packet_device module (#23127)
* Improvements and fixes in the packet_device module

* add version_added to new args

* remove default value from facility

* changed 'lock' from deprecated arg to alias of 'locked'
2017-08-22 06:43:37 -07:00
Abhijeet Kasurde
be86d77a70 Add check for correct parsing of sysctl (#24540)
* PEP8 fixes
* Refactoring of code
* Check to skip non-comment lines which doesn't
  contain = character

Fixes #24453

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-08-18 15:31:26 -04:00
Abhijeet Kasurde
a572de626c Pep8 fixes for acl module (#24666)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-08-18 14:31:16 -04:00
Matt Clay
f8d6c71d09 Remove deleted files from legacy-files.txt. 2017-08-18 09:20:15 -07:00
Dag Wieers
78dfbed2a5 openbsd_pkg: Fix when failed, PEP8-compliant (#26018)
This PR includes:
- PEP8 compliancy
- A fix to ensure the module fails when it failed for a package
- Various cosmetic changes to documentation
- Make `state: present` the default (and not required)
2017-08-17 18:20:02 -04:00
Pilou
016cd0691c alternatives: handle absent link, add integration tests (#27967)
* alternatives: add integration tests

* alternatives: handle absent link (fix AttributeError)

Error occurred at least on Debian Stretch and OpenSuse 42.2:
Traceback (most recent call last):
  File "/tmp/ansible_RY6X41/ansible_module_alternatives.py", line 161, in <module>
    main()
  File "/tmp/ansible_RY6X41/ansible_module_alternatives.py", line 113, in main
    current_path = current_path_regex.search(display_output).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

update-alternatives stdout sample:
dummy - manual mode
  link best version is /usr/bin/dummy1
  link currently absent
  link dummy is /usr/bin/dummy

* alternatives: PEP 8 fixes

* alternatives: fix copyright in integration tests

* alternatives: nested loops handle more than 2 items

Thanks to Michael Scherer (@mscherer) for pointing that.

* alternatives: enable integration tests
2017-08-16 10:35:56 -04:00
Toshio Kuratomi
af2073d057 metadata 1.1
* Add network value to support_by field.
* New support_by value, certified
* Deprecate curated in favor of certified
* Add conversion from 1.0 to 1.1 to metadata-tool
* Add supported by Red Hat field to ansible-doc output
2017-08-15 23:12:08 -07:00
Pierre-Louis Bonicoli
f69333b80d circonus_annotation: fix broken import, update requirements 2017-08-15 19:07:21 -07:00
Brian Coca
f921369445 Ansible Config part2 (#27448)
* Ansible Config part2

- made dump_me nicer, added note this is not prod
- moved internal key removal function to vars
- carry tracebacks in errors we can now show tracebacks for plugins on vvv
- show inventory plugin tracebacks on vvv
- minor fixes to cg groups plugin
- draft config from plugin docs
- made search path warning 'saner' (top level dirs only)
- correctly display config entries and others
- removed unneeded code
- commented out some conn plugin specific from base.yml
- also deprecated sudo/su
- updated ssh conn docs
- shared get option method for connection plugins
- note about needing eval for defaults
- tailored yaml ext
- updated strategy entry
- for connection pliugins, options load on plugin load
- allow for long types in definitions
- better display in ansible-doc
- cleaned up/updated source docs and base.yml
- added many descriptions
- deprecated include toggles as include is
- draft backwards compat get_config
- fixes to ansible-config, added --only-changed
- some code reoorg
- small license headers
- show default in doc type
- pushed module utils details to 5vs
- work w/o config file
- PEPE ATE!
- moved loader to it's own file
- fixed rhn_register test
- fixed boto requirement in make tests
- I ate Pepe
- fixed dynamic eval of defaults
- better doc code

skip ipaddr filter tests when missing netaddr
removed devnull string from config
better becoem resolution

* killed extra space with extreeme prejudice

cause its an affront against all that is holy that 2 spaces touch each other!

shippable timing out on some images, but merging as it passes most
2017-08-15 16:38:59 -04:00
Ivan Bojer
8b617aaef5 Panos object (#28028)
* - deprecated panos_address and panos_service in lieu of common panos_object

* - deprecated/removed panos_address and panos_service in lieu for panos_object

* squash! - deprecated/removed panos_address and panos_service in lieu for panos_object

* - fixed PEP8 issues

* - ansible_metadata requires metadata_version instead of just version key in 2.4

* add > to multi line descriptions

* update version string to 2.4

* Update legacy-files.txt
2017-08-15 16:24:15 -04:00
Nathaniel Case
1d13624eae Clean up nxos_aaa_server (#28177)
* cleanup nxos_aaa_server

* Specify nxos_aaa_server output format

Fixes #27289
2017-08-15 12:08:03 -04:00
Sam Doran
271127113f Add comment option to authorized_key (#27781)
* Add comment option to authorized_keys

* Update version_added for authorized_keys comment

* PEP8

* Include index rank in parsed_key_key

*  Properly display diff

Only display diff if specificed via settings

* Fix PEP8 test failure

Removed from legacy files since it is now properly formatted

* Cleanup integration test formatting and add test for new comment feature

* Correct version_added for new option
2017-08-15 10:50:50 -04:00
Pilou
a3f91274b3 circonus_annotation: DOCUMENTATION & argument_spec cleaning (#26832)
* circonus_annotation: clean description

- add 'default' field
- default value for 'required' field is false
- use formatting function

* circonus_annotation: clean argument_spec

remove useless conversion
default of 'required' False
use 'default' when possible

* circonus_annotation: fix pep8

* circonus_annotation: add RETURN block

* circonus_annotation: check_mode isn't supported, add a note
2017-08-14 18:40:00 -07:00
Sam Doran
68060002e8 Rename modules from plural to singular (#27185)
* First batch of modules renamed from plural to singular

Related to this proposal: https://github.com/ansible/proposals/issues/10

* Emit rename deprication warning

* Update legacy-files.txt and skip.txt to reflect new names
2017-08-14 16:35:15 -04:00
Pierre-Louis Bonicoli
4ecf85392e udm_user: fix broken import
Tested with:
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
n = datetime.now()
assert n + timedelta(days=365) == n + relativedelta(years=1)
2017-08-12 10:45:12 -07:00
Pierre-Louis Bonicoli
c52f355bcb serverless: fix broken import 2017-08-12 10:39:10 -07:00
Pierre-Louis Bonicoli
f761fc1d1f rhn_channel: fix py3 compatibility (use six)
and remove unused import
2017-08-12 10:21:14 -07:00
Pilou
feff6abd72 os_client_config: fix broken import (#26839)
* os_client_config: fix broken import
* remove wildcards and add boilerplate
2017-08-12 10:07:49 -07:00
Toshio Kuratomi
7cd81b802d Fix wildcard imports, remove get_exception, add boilerplate
Fixed for monitoring modules
2017-08-12 03:13:53 -07:00
Sloane Hertel
aca1950150 iam certificate facts (duplicate): add iam_cert_facts as alias for iam_server_certificate_facts (#25387)
* add iam_cert_facts as alias for iam_server_certificate_facts
* remove from legacy files
2017-08-12 01:44:39 -07:00
Toshio Kuratomi
ac56a2f138 Remove wildcard imports and get_exception calls
Fixed module_utils
2017-08-12 00:48:53 -07:00
Sloane Hertel
1de91a9aa0 [cloud] Convert s3 module to use boto3 (#21529)
* replace boto with boto3 for the s3 module

make s3 pep8 and remove from legacy files

fix s3 unit tests

* fix indentation

* s3 module - if we can't create an MD5 sum return None and always upload file

* remove Location.DEFAULT which isn't used in boto3 and tidy up the docs

* pep8

* s3: remove default: null, empty aliases, and required: false from documentation

fix incorrectly documented defaults

* Porting s3 to boto3. Simplify some logic and remove unused imports

* Fix s3 module variables

* Fix a typo in s3 module and remove from pep8 legacy files

* s3: add pagination for listing objects.

Fix logic and use head_object instead of get_object for efficiency.

Fix typo in unit test.

* Fix pagination to maintain backwards compatibility.

Fix incorrect conditional.

Remove redundant variable assignment.

Fix s3 list_object pagination to return all pages

* Use the revised List Objects API as recommended.

* Wrap call to paginated_list in a try/except

Also remembered to allow marker/prefix/max_keys to modify what keys are listed

* Simplify argument
2017-08-11 09:34:33 -04:00
Abhijeet Kasurde
f7321a87ca Pep8 fixes for rabbitmq modules (#24590)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-08-10 11:57:11 +02:00
Dag Wieers
eee09565b1 utilities modules: PEP8 compliancy (#27741) 2017-08-10 09:36:28 +01:00
Colin Nolan
db50650365 Adds support for all Consul 0.8 ACL rule scopes (#25800)
* Added in support for 'agent' and 'node' types.

* Tidies and moves `consul_acl` module closer to PEP8 compliance.

* Switched from using byspoke code to handle py2/3 string issues to using `to_text`.

* Made changes suggested by jrandall in https://github.com/ansible/ansible/pull/23467#pullrequestreview-34021967.

* Refactored consul_acl to support scopes with no pattern (and therefore a different HCL defintion).

* Corrects whitespace in Consul ACL HCL representation.

* Fixes Consul ACL to return the HCL equivalent JSON (according to the Consul docs) for the set ACLs.

* Repositioned import to align with Ansible standard (!= PEP8 standard).

* Adds Python 2.6 compatibility.

* Fixes PEP8 issues.

* Removes consul_acl.py as it now passes PEP8.

* Follows advice in the "Documenting Your Module" guide and moves imports up from the bottom.

* Tidies consul_acl module documentation.

* Updates link to guide about Consul ACLs.

* Removes new line spaces from error message string.

* Provide better error message if user forgets to associate a value to a Consul ACL rule.

* Minor refactoring of Consul ACL module.

* Fixes bug that was breaking idempotence in Consul ACL module.

* Detects redefinition of same rule.

* Adds test to check the Consul ACL module can set rules for all supported scopes.

* Fixes return when updating an ACL.

* Clean up of Consul ACL integration test file.

* Verify correct changes to existing Consul ACL rule.

* Adds tests for idempotence.

* Splits Consul ACL tests into cohesive modules.

* Adds test for deleting Consul ACLs.

* Test that Consul ACL module can set all rule scopes.

* Fixes issues surrounding the creation of ACLs.

Thanks for the comments by manos in https://github.com/ansible/ansible/pull/25800#issuecomment-310137889.

* Stops Consul ACL's name being "forgotten" if ACL updated by token.

* Fixes incorrect assignment when a Consul ACL is deleted.

* Fixes value of `changed` when Consul ACL is removed.

* Fixes tests for Consul ACL.

* Adds interal documentation.

* Refactors to separate update and create (also makes it possible to unit test this module).

* Improves documentation.

* Completes RETURN documentation for Consul ACL module.

* Fixes issue with equality checking for `None` in ACL Consul.

* Fixes Python 2 issue with making a decision based on `str` type.

* Fixes inequality check bug in Python 2.

* Adds tests for setting ACL with token.

* Adds support for creating an ACL with a given token.

* Outputs operation performed on Consul ACL when changed.

* Fixs issue with test for creating a Consul ACL with rules.

* Corrects property used to set ACL token in python-consul library.

* Fixes tear-down issue in test that creates a Consul ACL using a token.
2017-08-09 15:21:12 -04:00
Nathaniel Case
01dda25e0f fix nxapi transport in nxos_snmp_location (#27849)
* fix nxapi transport in nxos_snmp_location

* Appease Shippable
2017-08-09 09:44:02 -04:00
Moritz Grimm
11af034255 moved aws elasticache module to boto3 (#27441)
* moved aws elasticache module to boto3

* fixed error and improved code

* implemented requested changes

* now checking for missing boto3 packages in a better way

* now dynamically setting the default port depending on the engine if it is not set

* moved standard import in front of ansible ones

* now case insensitive in regards to engine name

* removed superfluous spaces

* now checking for None in the correct way

* removed elasticache module from exceptions to pep8 testing

* removed hardcoded default ports and letting aws decide if no port is given
2017-08-08 08:39:09 -04:00
Willem van Ketwich
6d402de25e ec2 launch configuration boto3 upgrade (#26348)
Updates ec2_lc module to use boto3. Adds parameters:

instance_id
placement_tenancy

Also added a second example using instance_id and updated the docs with the new parameters.
2017-08-08 22:11:06 +10:00
Toshio Kuratomi
44935a5db6 Add a (disabled) code-smell test for detecting _ variables
We are reserving the _ identifier for i18n work.  Code should use the
identifier dummy for dummy variables instead.

This test is currently skipped as someone needs to generate the list of
files which are currently out of compliance before this can be turned
on.
2017-08-07 11:11:31 -07:00
Dag Wieers
71163d4d61 vmware_cluster: PEP8, imports, cosmetics (#25140)
This PR includes:
- Documentation improvements (mostly related to boolean defaults)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
2017-08-07 12:44:27 -04:00
Nathaniel Case
b9e80b6117 nxos_vrf_interface cleanup (#27642)
* Update RETURN, results, & execute_show_command
2017-08-07 10:57:45 -04:00
René Moser
fdaa803cca cloudstack: cs_vmsnapshot: fix pep8 (#27792) 2017-08-05 10:34:17 +02:00
Dag Wieers
25e67d804c iso_extract: Reimplement using 7zip (not requiring root) (#24937)
* Reimplement iso_extract using 7zip (not requiring root)

So one of the drawbacks of the original implementation is that it required root for mounting/unmount the ISO image.
This is now no longer needed as we use 7zip for extracting files from the ISO.

* Fall back to using mount/umount if 7zip not found

As discussed with others.

Also improved integration tests.
2017-08-04 14:38:42 -04:00
Dag Wieers
a98e3fb81f Add RETURN information, doc improvements and PEP8
This PR includes:
- RETURN information (since the difference between status_code and
  status was confusing)
- Improvements to parameter definition (and docs)
- PEP8 compliancy
2017-08-04 08:21:50 -07:00
Pilou
b57af4428d rhn_register: fix broken imports, add unit tests (#26878)
Fix 'module' object is not callable

* rhn_register: fix Python 3 compatibility
* rhn_register: update requirements
* rhn_register: add unit tests
* Add missing method name
* use a dedicated line for XML related requirements
* rhn_register: drop support for Python 2.4
* rhn_register unit tests: fix Python 3 compatibility
* refactor in order to check order of the requests
2017-08-04 10:12:27 -04:00
Dag Wieers
0342760f5b sefcontext: PEP8 compliancy (#27742) 2017-08-04 10:01:17 -04:00
René Moser
5700b09610 cloudstack: new module cs_instance_nic_secondaryip, replaces cs_nic (#26491) 2017-08-04 15:01:12 +02:00
Dag Wieers
a34ef12d73 hpilo modules: PEP8 fixes (#27739) 2017-08-04 11:52:31 +02:00
Dag Wieers
bcb3e33adb command: PEP8 compliancy (#27740) 2017-08-04 08:39:13 +02:00
Toshio Kuratomi
fbf6cb8fff Add boilerplate to fetch.py
This completes the modules/files directory so we can now check it for
regressions.
2017-08-03 13:15:12 -07:00
Toshio Kuratomi
f4d7b9a596 code-smell test changes
* Create get_exception and wildcard import code-smell tests
* Add more detail to boilerplate and no-basestring descriptions
* Remove the no-list-cmp test as the pylint undefined-variable test covers it
2017-08-03 13:15:12 -07:00
Pierre-Louis Bonicoli
33e8c83fde vca_nat: 'import' test is successful 2017-08-03 13:12:25 -07:00
Abhijeet Kasurde
97240a9ebc Fix for missing import and boilerplate
Fix adds missing imports and boilerplate for proxysql.
It also remove get_exception calls in-favor of native exception.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-08-03 09:40:44 -07:00
Jordan Borean
8bb10bb225 removed requirements on WANT_JSON and POWERSHELL_COMMON (#27679) 2017-08-02 18:47:17 -07:00
Abhijeet Kasurde
5e2184c683 Fixing broken imports and get_exception for ipa
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-08-02 09:53:02 -07:00
Nathaniel Case
b93878b685 Minor cleanup to nxos_vrrp (#27593)
* Safe changes

* Fold `[0]` into `execute_show_command()`

We only ever execute one command, so only return the one response

* Streamline `results`
2017-08-02 08:46:44 -04:00
Robin Roth
b134352d8c WIP: Replace boilerplate (#27554)
* Replace boilerplate

* Enable test on packaging/os
2017-08-01 14:37:37 -07:00
Sloane Hertel
ad2c1e1838 [cloud] ec2_customer_gateway: add routing option to allow bgp_asn to be optional (#27276)
fixes #27157

 add routing option to allow bgp_asn to be optional
2017-08-01 14:54:34 -04:00
Pilou
49b8bd0358 Fix broken import in utilities.helper._accelerate (#27088)
* Fix py3 compatibility using six.moves.socketserver

* Remove useless call to str
2017-07-31 22:05:46 -07:00
Toshio Kuratomi
0b9a78f0b3 Remove wildcard, add boilerplate and get rid of get_exception
* smaller collections of database modules
* Some of the smaller collections of network modules
2017-07-31 13:51:38 -07:00
Toshio Kuratomi
4109a82d0a remove wildcards and add boilerplate
* cloud/centurylink
* source_control
* cloud/google
* notification
* cloud/rackspace
* cloud/vmware
2017-07-29 14:13:30 -07:00
Toshio Kuratomi
21564cdb98 Add some features to the pylint sanity check
* Enable specific tests (this lets us disable a group and then
  enable a particular test inside of it)
* Comment out tests in the enable and disable files
2017-07-29 14:13:30 -07:00
Toshio Kuratomi
0765ceb66d revise ordered list of boilerplate work 2017-07-29 07:02:12 -07:00
Toshio Kuratomi
8de6cff2b1 more wildcards 2017-07-29 07:02:12 -07:00
Toshio Kuratomi
1ee08c0f06 Get rid of more wildcard imports and add boilerplate to more modules
This commit cleans up the following module categories:
* messaging
* inventory
* crypto
* commands
* clustering
* cloud/webfaction
* cloud/docker
* cloud/digital_ocean
2017-07-29 07:02:12 -07:00
Toshio Kuratomi
6f69cd4501 Add code to allow from __future__ in docs-only modules 2017-07-28 22:10:17 -07:00
Toshio Kuratomi
8b7db55a94 Modify boilerplate code-smell test to check some of the module dirs 2017-07-28 22:10:17 -07:00
Toshio Kuratomi
4e6cce354e Remove wildcard imports
Made the following changes:

* Removed wildcard imports
* Replaced long form of GPL header with short form
* Removed get_exception usage
* Added from __future__ boilerplate
  * Adjust division operator to // where necessary

For the following files:

* web_infrastructure modules
* system modules
* linode, lxc, lxd, atomic, cloudscale, dimensiondata, ovh, packet,
  profitbricks, pubnub, smartos, softlayer, univention modules
* compat dirs (disabled as its used intentionally)
2017-07-28 22:10:17 -07:00
Yanis Guenane
9e41fd399b Removing openssl_publickey from pep8 legacy files (#27414) 2017-07-28 11:10:02 +02:00
Toshio Kuratomi
30a688d8d3 Update conventions in azure modules
* Remove wildcard imports
* Update GPL header to the one-line form
* Add from __future__ imports
2017-07-27 15:37:26 -07:00
Toshio Kuratomi
3a2670e0fd Allow specific __future__ imports in modules
We do want to allow certain from __future__ imports in modules that make
it easier to code compatible python2 and python3.  Note that
unicode_literals is specifically left out and should never be allowed.
Now that python-3.4+ allows u"" there's no good reason to use
unicode_literals.

Also switch tables in the validate_modules documentation to simple table format
2017-07-27 15:37:26 -07:00
David Newswanger
81151ef02c Remove Deprecated Template network modules (#27076)
* removed deprecated networking template modules

* update changelog

* update changelog
2017-07-27 19:40:11 +01:00
Trishna Guha
7351ee9a76 fix nxos_interface multiple issues (#27106)
* fix execute_show_command

* fix pep8 issues

* fix AttributeError #26562

* legacy-file remove

* modify execute_show_command output

* fix admin_state up doc

* fix admin_state for all interfaces doc

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-07-27 19:23:35 +05:30
Abhijeet Kasurde
b2d609b6f1 Add testcase for ipify_facts (#26421)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-26 12:16:10 +02:00
Toshio Kuratomi
225fa5d092 Fix undefined variables, basestring usage, and some associated python3 issues 2017-07-25 15:58:23 -07:00
Toshio Kuratomi
9f7b0dfc30 Remove automatic use of system six
* Enable the pylint no-name-in-module check.  Checks that identifiers in
  imports actually exist.  When we do this, we also have to ignore
  _MovedItems used in our bundled six.  This means pylint won't check
  for bad imports below ansible.module_utils.six.moves but that's
  something that pylint punts on with a system copy of six so this is
  still an improvement.
* Remove automatic use of system six.  The exec in the six code which
  tried to use a system library if available destroyed pylint's ability
  to check for imports of identifiers which did not exist (the
  no-name-in-module check).  That test is important enough that we
  should sacrifice the bundling detection in favour of the test.
  Distributions that want to unbundle six can replace the bundled six in
  ansible/module_utils/six/__init__.py to unbundle.  however, be aware
  that six is tricky to unbundle.  They may want to base their efforts
  off the code we were using:

  2fff690caa/lib/ansible/module_utils/six/__init__.py

* Update tests for new location of bundled six Several code-smell tests
  whitelist the bundled six library.  Update the path to the library so
  that they work.

* Also check for basestring in modules as the enabled pylint tests will
  also point out basestring usage for us.
2017-07-25 15:58:23 -07:00
Toshio Kuratomi
da3d3d512e Enable pylint checking for undefined variables 2017-07-25 15:58:23 -07:00
Yanis Guenane
d72ac0b391 openssl_privatekey: Standardize implementaton of the module
The OpenSSLObject class has been merged[1]. This commit makes the
openssl_privatekey rely on this class and standardize the way openssl
module should be written.

Co-Authored-By: Christian Pointner <cpointner@mgit.at>

[1] https://github.com/ansible/ansible/pull/26945
2017-07-25 15:31:11 +02:00
Toshio Kuratomi
035be94271 Fix cloudformation module for import of non-module_utils file 2017-07-24 18:19:32 -07:00
Rob
3401a4b330 Rename classic elb modules to match new names applied to application LB modules (#25745) 2017-07-24 16:28:02 -04:00
Abhijeet Kasurde
9649195c26 Refactor getvm method (#27188)
Fix refactors getvm method and modules which are using it.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-24 12:51:26 -04:00
Dag Wieers
be1c517f4d Add example of templating inline using copy module (#19752)
* Add example of templating inline using copy module

The **copy** module documentation implies that `content:` only works
for 'simple values' and for complex stuff you need the **template**
module, but that is an understatement. You can use **copy** to template
anything you desire.

So I changed the wording, added an example, and also added a note
to the template module that the **copy** module could be used for
'inline templating'.

This fixes #19741.
2017-07-22 22:12:31 -07:00
Toshio Kuratomi
df15583ad0 Promulgate house's fix for docker_volume to docker_secret
* Revert change to docker_common as it's not as good as the try: except fix
* limit docker_volume fix to ImportErrors
* fix docker_secret i nthe same way
* Remove docker_secret from import tests
2017-07-19 13:20:47 -07:00
Sloane Hertel
79e54f4006 [cloud] s3_bucket: policy comparison - fixes #25428 (#25723)
Creates a new way to compare bucket policies by making their elements hashable & comparing that way after normalizing syntax like single-item lists.
2017-07-19 07:01:33 -04:00
Matt Clay
09146e5573 Add files failing import test to skip list. 2017-07-18 11:04:00 -07:00
René Moser
30ad30c470 cloudstack: remove CloudStackException dep for several modules (#26874)
* cloudstack: cs_affinitygroup: remove CloudStackException dependency

* cloudstack: cs_domain: remove CloudStackException dependency

* cloudstack: cs_firewall: remove CloudStackException dependency

* cloudstack: cs_host: remove CloudStackException dependency

* cloudstack: cs_instancegroup: remove CloudStackException dependency

* cloudstack: cs_pod: remove CloudStackException dependency

* cloudstack: cs_configuration: remove CloudStackException dependency, fix pep8

* cloudstack: cs_cluster: remove CloudStackException dependency

* cloudstack: cs_network_acl: remove CloudStackException dependency

* cloudstack: cs_network_acl_rule: remove CloudStackException dependency

* cloudstack: cs_zone_facts: remove CloudStackException dependency

* cloudstack: cs_zone: remove CloudStackException dependency

* cloudstack: cs_vpn_gateway: remove CloudStackException dependency

* cloudstack: cs_vpc: remove CloudStackException dependency

* cloudstack: cs_sshkeypair: remove CloudStackException dependency

* cloudstack: cs_role: remove CloudStackException dependency

* cloudstack: cs_ip_address: remove CloudStackException dependency

* cloudstack: cs_ip_staticnat: remove CloudStackException dependency

* cloudstack: cs_resourcelimit: remove CloudStackException dependency

* cloudstack: cs_region: remove CloudStackException dependency

* cloudstack: cs_project: remove CloudStackException dependency

* cloudstack: cs_network: remove CloudStackException dependency

* cloudstack: cs_loadbalancer_rule_member: remove CloudStackException dependency

* cloudstack: cs_loadbalancer_rule: remove CloudStackException dependency

* cloudstack: cs_iso: remove CloudStackException dependency
2017-07-16 22:05:14 +02:00
Rene Moser
9543025b91 cloudstack: cs_router: fix pep8 2017-07-16 11:46:10 +02:00
René Moser
1d907de966 cloudstack: cs_user: fix pep8 and minor restyling (#26849) 2017-07-15 19:16:53 +02:00
Pilou
d9265c7498 os_ironic: fix broken import (#26802) 2017-07-15 08:44:50 -05:00
Nathaniel Case
61249995a1 Update nxos_interface_ospf & add test (#26644)
* Update nxos_interface_ospf & add test
2017-07-14 12:31:36 -04:00
Matt Clay
789218c215 Initial ansible-test sanity docs. (#26775)
* Rename no-iterkeys test for consistency.

* Require docs for all ansible-test sanity tests.

* Initial ansible-test sanity docs.

* Fix capitalization of Python.

* Fix sanity code smell test false positives.

* Fix another code-smell false positive.
2017-07-14 14:24:45 +01:00
Matt Clay
462444b2be PEP 8 fix. 2017-07-13 15:07:40 -07:00
Pilou
4b3d6dfa8a Use pycodestyle instead of pep8 (#25947) 2017-07-13 11:46:31 -07:00
Matt Clay
0b784c65b1 Add sanity import test to ansible-test. (#26730)
* Add sanity import test to ansible-test.
* Run sanity import test on all python versions.
2017-07-12 20:04:22 -07:00
Nathaniel Case
5cfdd5df0f nxos_pim_interface (#26367)
* Add unit tests to nxos_pim_interface

* Update tests to match module

* Update nxos_pim_interface

* Address pep8 issues
2017-07-12 15:39:43 -04:00
Peter Sprygada
0b6f0e6c0d adds more intelligent save logic and diff to network config modules (#26565)
* adds more intelligent save logic and diff to network config modules

* adds sha1 property to NetworkConfig
* adds new argument save_when to argument_spec
* adds new argument diff_against to argument_spec
* adds new argument intended_config to argument_spec
* renames config argument to running_config with alias to config
* deprecates the use of the save argument
* before and after now work with src argument
* misc module clean

Modules updated
* nxos_config
* ios_config
* eos_config

Most notably this makes the save mechanism more intelligent for config
modules for devices that need to copy the ephemeral config to
non-volatile storage.

The diff_against argument allows the playbook task to control what the
device's running-config is diff'ed against. By default it will return
the diff of the startup-config.

* removes ios_config from pep8/legacy_files.txt

* extends the ignore lines argument to the module

* clean up CI errors

* add missing list brackets

* fixes typo

* fixes unit test cases

* remove last line break when returning config contents

* encode config string to bytes before hashing

* fix typo

* addresses feedback in PR

* update unit test cases
2017-07-11 20:34:20 -04:00
Rene Moser
3dc379c89d cloudstack: cs_iso: add update support, fixes pep8 2017-07-12 00:49:37 +02:00
Adrian Likins
261c40bac7 Fix azure module use of module_utils.facts (#25318)
Module was importing '*' from facts to get to TimeoutError
but that has moved to facts.timeout, so import is updated.

Also rm old style imports to new style imports at the start
of the module.

'signal' py module was used and referenced but never imported,
presumably it was using the 'signal' previously imported into
module_utils.facts. Now imported directly.

'AnsibleModule' was also from a * import, so now imported directly.

A ref to 'module' was in _delete_disks_when_detached(), so now it
is updated to raise an AzureException() with its message, and
let its caller catch it and call module.fail_json()
2017-07-11 14:07:20 -04:00
René Moser
3050856f2a cloudstack: cs_instancegroup: fix pep8 (#26534) 2017-07-07 19:08:39 +02:00
Dag Wieers
f8982dcbd0 wakeonlan: Add integration tests and improvements (#26254)
This PR includes:
- Checkmode improvements
- Integration tests
- A fix for python3
- PEP8 fixes

This backports improvements from the win_wakeonlan module.
2017-07-07 10:52:02 +01:00
Trishna Guha
c5fb4bbcc0 Fix nxos_switchport and unit test (#26131)
* fix nxos_switchport

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* nxos_switchport unit test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* legacy file

* update unit test

* handle exception
2017-07-06 18:58:36 +05:30
Abhijeet Kasurde
3004c913e6 Pep8 fixes for opendj_backendprop_* (#24587)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-06 09:50:26 +01:00
Will Thames
f8d522de69 Support check mode for efs_facts (#26273)
Facts modules support check mode by default

Fix pep8 compliance
2017-07-05 15:06:08 +02:00
Brian Coca
272f5fd03a avoid doing cmp on .git 2017-07-03 15:15:49 -04:00
Abhijeet Kasurde
f0a5854e39 Fix unresolved import in vmware module_utils (#25288)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-30 10:28:08 -04:00
Abhijeet Kasurde
5c374cd1ae Add Test Suite for vmware_vswitch (#26076)
Fix adds test suite for vwmare_switch

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-30 10:18:20 -04:00
Rob
d1652aecf0 Upgrade ec2_remote_facts to use boto3 (#22937)
* Deprecate ec2_remote_facts in favor of ec2_instance_facts which uses boto3

* Update legacy-files.txt with deprecated file name change
2017-06-30 14:19:08 +10:00
Nathaniel Case
3102746ebe nxos_pim_rp_address fixes (#26119)
* nxos_pim_rp_address tests

* nxos_pim_rp_address changes

* Address issues with idempotence
2017-06-29 10:22:26 -04:00
Nathaniel Case
ad6c4a544e nxos_pim updates (#26145)
* nxos_pim tests

* Cleanup nxos_pim
2017-06-28 19:40:19 -04:00
Nathaniel Case
eea18e9875 nxos_vxlan_vtep_vni fixes (#25913)
* nxos_vxlan_vtep_vni first pass
* nxos_vxlan_vtep_vni tests
2017-06-28 19:38:31 -04:00
Abhijeet Kasurde
bb847e332d Check if SELinux is installed on system (#24437)
* Refactor code
* PEP8 fixes
* Check if /etc/selinux/config file exists before
  proceeding any other operations

Fixes #21622

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-28 19:39:52 +01:00
Nathaniel Case
21c7fcf9c0 nxos_vxlan_vtep (#25971)
* nxos_vxlan_vtep tests

* Fix issues with nxos_vxlan_vtep
2017-06-24 14:09:11 -04:00
Trishna Guha
3482a6326b Fixes nxos_vpc_interface (#25907)
* nxos_vpc_interface fix

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* nxos_vpc_interface unit test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fix state_present

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* add state_present unit test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* make ansibot happy

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* teardown get_config

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-06-24 18:05:07 +05:30
Mark Szymanski
1703db4211 Allow iam_cert to be renamed or moved without needing to specify cert or key data (#20622)
Generally Pep8 and flake8 compliant so removing from legacy-files.txt
2017-06-23 15:32:15 +10:00
Matt Clay
75a3ac5ca5 Fix test for missing __init__.py for modules. 2017-06-22 12:19:25 -07:00
Ganesh Nalawade
b2f46753ec Add junos_system declartive module and other related change (#25859)
* Add junos_system declartive module and other related change

*  junos_system declartive module
*  integration test for junos_system
*  integration test for net_system (junos platform)
*  pep8 fixes for junos modules
*  move to lxml from elementree for xml parsing as it support
   complete set of xpath api's
*  other minor changes

* Fix CI and doc changes

* Fix unit test failures

* Fix typo in import

* Fix import issue for py2.6

* Add missed Element in import
2017-06-22 09:34:50 +05:30
Steffen Neubauer
759750e661 Consul: make service_port optional in service definition, like specified in Consul docs (#21737)
* Consul: make service_port optional in service definition, Fixes #21727

* Remove consul module from legacy-files.txt

* consul: Pep8 fixes
2017-06-19 19:29:40 +01:00
John R Barker
5551e87755 RETURNS can include version_added (#25810) 2017-06-16 20:17:38 +01:00
René Moser
a51d64dfe3 constants: pep8 fix (#25735) 2017-06-15 13:40:06 +02:00
Sloane Hertel
dfcf43efa9 ec2: Allow EC2-VPC instances to modify security groups - fixes #18928 (#23831)
* Allow EC2-VPC instances to update SG

make ec2 pep8

* use sets instead of loop and a break

* bring things in an indentation level

* Use to_text instead of str, text_type instead of basestring, - instead of difference

* basestrings not unicode

* simplifying syntax
2017-06-14 11:10:29 -04:00
Brian Coca
74842adc07 1st part of ansible config, adds ansible-config to view/manage configs (#12797)
* Start of ansible config project

moved configuration definitions to external yaml file vs hardcoded
 * updated constants to be a data strcutures that are looped over and also return origin of setting
changed to manager/data scheme for base classes
new cli ansible-config to view/manage ansible configuration settings
 * prints green for default/unchanged and yellow for those that have been overriden
 * added list action to show all configurable settings and their associated ini and env var names
 * allows specifying config file to see what result would look like
 * TBD update, edit and view options

removed test for functions that have been removed

env_Vars are now list of dicts
allows for version_added and deprecation in future
added a couple of descriptions for future doc autogeneration
ensure test does not fail if delete_me exists
normalized 'path expansion'
added yaml config to setup packaging
removed unused imports
better encoding handling

updated as per feedback

* pep8
2017-06-14 11:08:34 -04:00
Dag Wieers
cf30b162a9 vmware_guest: Various fixes to VM customizations (from template) (#24768)
* Various fixes to VM customizations (from template)

This patch implements:
- New find_obj() function from vmware.py replacing get_obj()
- Implement proper resource_pool selection
- Fix productId implementation (was not working)
- Ensure that we are not changing anything that is not mandatory (hostName, orgName, fullName)


This is an alternative proposal to #24283
This does not fix #19860 yet though.

For our use-case, we do not want to customize the network information (or any information in fact).
What is used in the template should remain intact.

* Added find_obj() function

* Fix the returned object-list (unused yet)

* Small improvement

* Support DHCP type and fix customizations

* Small fix

* Support resource_pool also for reconfiguring VM

* Remove redundant

* Fix short hostname, specific resource_pool, PEP8

* Improve docs and examples

* Fix missing hostsystem

* Make folder absolute path

* Improve docs, add missing 'mac'
2017-06-13 17:50:55 -04:00
Matt Martz
cb704a4310 If there are no DOCs provided at all, don't traceback, skip the _ensure_imports_below_docs test (#25621) 2017-06-12 16:47:06 -05:00
Abhijeet Kasurde
da6f6d27e8 Add Description parameter in os_user
Fixes #18914

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-12 10:56:34 -04:00
Will Thames
16b877e2b3 ec2_asg and ec2_asg_facts module improvements (#25166)
* ec2_asg and ec2_asg_facts module improvements

Return target group information for both ec2_asg and ec2_asg_facts
modules

Provide RETURN documentation for ec2_asg module

PEP8 fixes for ec2_asg_facts

* ec2_asg: use pagination when describing target groups

In case an ASG has 100s of target groups, ensure that
we get the full result using build_full_result
2017-06-12 07:15:04 -04:00
Pilou
460d932aa8 postgresql_user: fix bugs related to 'expires' option (#23862)
* Factorize tests related to no_password_change using an include task

* Refactor: deduplicate tasks

* postgresql_user: test 'expires' parameter

* Change 'valid until' even it's the only updated field

* value is changed when another value is provided

* value isn't returned when unset

* Remove unused variable

* psycopg2.extras.DictRow is able to handle comparison

* postgresql_user: simplify helper method

* postgresql_user: define variable just before using it

* Fix comparison between user input and applied configuration

* new test: adding an invalid attribute

* Refactor, add cleaning task

* Check that using same attribute a 2nd time does nothing

* Always try to remove created user

* postgresql_user: fix pep8
2017-06-11 14:48:39 -07:00
René Moser
29817ab115 cloudstack: add tests, fix pep8 (#25518)
* cloudstack: cs_zone: fix pep8

* cloudstack: cs_zone: add tests
2017-06-09 18:48:53 +02:00
Sloane Hertel
b376bde4d7 [cloud] ec2_eni module - allow attaching a new instance - fixes #19452 (#22377)
* fix bug attaching instances

* pep8
2017-06-09 11:31:42 -04:00
Tim Rupp
61684f7313 Updates gtm wide ip module to be feature complete (#25502)
This module is used to manage GTM wide ips on a bigip.
Previously, this module only included a small subset of functionality
primarily related to editing a wide ip that already existed. Additionally
it used the SOAP api for its communication. this patch completes the
feature set of wide ips and refactors the code to use the F5 python SDK
and the REST API.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_gtm_wide_ip.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_gtm_wide_ip/tasks
2017-06-09 16:07:14 +01:00
Dag Wieers
6e98dbbfd7 wait_for: PEP8, imports, cosmetics (#24634)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)

This fixes #19781
2017-06-08 11:06:11 +02:00
Chris Houseknecht
20bddde669 docker_service: Forward stderr-based output from docker-compose (#25456)
PR #5165 at https://github.com/ansible/ansible-modules-core/pull/5165
adds redirection and capture of stdout during execution of
docker-compose.

This doesn't necessarily catch all errors, since some are printed to
stderr and lost.

This extends the redirection to include stderr, and does minor string
processing to attempt to find a 'useful' message to present as the
final Ansible error.
2017-06-07 23:30:26 -04:00
Matt Martz
e86b00b917 Make validate-modules a .py file, and symlink back to validate-modules (#25227)
* Make validate-modules a .py file, and symlink back to validate-modules

* Set prog for argparse in valdiate-modules
2017-06-07 14:44:33 -05:00
Mike Wiebe
b76acc8ce8 Fix nxos_vpc idempotence issues (#25219)
* Fix nxos_vpc idempotence issues

* Remove legacy-file pep8 now passing
2017-06-07 10:35:08 -04:00
Abhijeet Kasurde
5bd4e01533 Update documentation of pamd module (#24712)
Updated explanation and documentation of new_module*
in pamd documentation

Fixes #24516

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-07 08:48:42 +01:00
Abhijeet Kasurde
65bd5c4d56 Refactor github_hook module (#24391)
* PEP8 fixes
* Refactoring for fetch_url call
* Removed un-used code

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-07 07:52:03 +02:00
Abhijeet Kasurde
677a6c2982 Pep8 fixes for ejabberd_user and jboss (#24586)
* PEP* Fixes
* Refactor code

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-07 07:35:22 +02:00
René Moser
894b86a467 cloudstack: cs_zone_facts: add tests and fix pep8 (#25407) 2017-06-07 00:35:24 +02:00
René Moser
3e02b19b98 cloudstack: fix pep8 cs_project (#25322) 2017-06-03 01:42:03 +02:00
Will Thames
84eea2a7e3 Support check_mode in ec2_vpc_nacl (#23112)
* Support check_mode in ec2_vpc_nacl

Ensure that all API calls that make changes are guarded by
`if not module.check_mode`.

* Update ec2_vpc_nacl_facts to latest pep8 standards
2017-06-02 13:15:38 -04:00
Dag Wieers
8cbed3c534 unarchive: PEP8, imports, cosmetics (#24654)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
2017-06-02 16:22:52 +01:00
Brandon Davidson
0e0c5328fa amazon/ec2_vpc_igw: Allow internet gateways to be tagged (#23782) 2017-06-02 07:38:50 -04:00
Dag Wieers
5553b20828 Collated PEP8 fixes (#25293)
- Make PEP8 compliant
2017-06-02 12:14:11 +01:00
Dag Wieers
2f33c1a1a1 find: PEP8, imports, cosmetics (#24646)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
2017-06-02 08:43:40 +01:00
Dag Wieers
91ee93ce13 patch: PEP8, imports, cosmetics (#24649)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
2017-06-02 08:42:40 +01:00
Ganesh Nalawade
85219dfdf3 Add support to fetch old style junos facts (#25250)
* Add support to fetch old style junos facts

Fixes #25050

Add support to fetch old style facts supported in Ansible <= 2.2
To fetch old style facts value `gather_subset` value shoule be `all`
and `junos-eznc` is required to be installed on control node as a
prerequisite.

* Remove unwanted import
2017-06-02 09:04:57 +05:30
Sloane Hertel
7160a491c2 elasticache: add requirements to parameter_group and snapshot (#24904)
* Add requirements to elasticache parameter group

* add requirements for elasticache_snapshot

* pep8 elasticache_snapshot

* remove elasticache_snapshot from legacy files
2017-06-02 00:18:02 +02:00
Adrian Likins
45a9f96774 Facts Refresh (2.4 roadmap) (#23012)
Facts Refresh (2.4 roadmap)

This commit implements most of the 2.4 roadmap 'Facts Refresh'
- move facts.py to facts/__init__.py
- move facts Distribution() to its own class
- add a facts/utils.py
- move get_file_content and get_uname_version to facts/utils.py
- move Facts() class from facts/__init__ to facts/facts.py
- mv get_file_lines to facts/utils.py
- mv Ohai()/Facter() class to facts/ohai.py and facter.py
- Start moving fact Hardware() classes to facts/hardware/*.py
- mv HPUX() hardware class to facts/hardware/hpux.py
- move SunOSHardware() fact class to facts/hardware/sunos.py
- move OpenBSDHardware() class to facts/hardware/openbsd.py
- mv FreeBsdHardware() and DragonFlyHardware() to facts/hardware/
- mv NetBSDHardware() to facts/hardware/netbsd.py
- mv Darwin() hardware class to facts/hardware/darwin.py
- pep8/etc cleanups on facts/hardware/*.py
- Mv network facts classes to facts/network/*.py
- mv Virtual fact classes to facts/virtual
- mv Hardware.get_sysctl to facts/sysctl.py:get_sysctl

- Also mv get_uname_version from facts/utils.py -> distribution.py
  since distribution.py is the only thing using it.

- add collector.py with new BaseFactCollector
- add a subclass for AnsibleFactCollector
- hook up dict key munging FactNamespaces
- add some test cases for testing the names of facts
- mv timeout stuff to facts.timeout

- rm ansible_facts()/get_all_facts() etc

- Instead of calling facts.ansible_facts(), fact collection
  api used by setup.py is now to create an AnsibleFactCollector()
  and call it's collect method.

- replace Facts.get_user_facts with UserFactCollector
- add a 'systems' facts package, mv UserFactCollector there
- mv get_dns_facts to DnsFactCollector
- mv get_env_facts to EnvFactCollector
- include the timeout length in exception message

- modules and module_utils that use AnsibleFactCollector
  can now theoretically set the 'valid_subsets'

  May be useful for network facts module that currently have
  to reimplement a good chunk of facts.py to get gather_subsets
  to work.

- get_local_facts -> system/LocalFactCollector
- get_date_time -> system/date_time.py
- get_fips_facts -> system/fips.py
- get_caps_facts() -> system/caps.py
- get_apparmor_facts -> system/apparmor.py
- get_selinux_facts -> system/selinux.py
- get_lsb_facts -> system/lsb.py
- get_service_mgr_facts -> system/service_mgr.py
- Facts.is_systemd_managed ->  system/service_mgr.py
- get_pkg_mgr_facts -> system/pkg_mgr.py
- Facts()._get_mount_size_facts() -> facts.utils.get_mount_size()

- add unit test for EnvFactCollector
- add a test case for minimal gather_subsets
- add test case for collect_ids
- Make gather_subset match existing behavior or '!all'

    If 'gather_subset' is provided as '!all', the existing behavior
    (in 2.2/2.3) is that means 'dont collect any facts except those
    from the Facts() class'. So 'skip everything except
    'apparmor', 'caps', 'date_time', 'env', 'fips', 'local', 'lsb',
    'pkg_mgr', 'python', 'selinux', 'service_mgr', 'user', 'platform', etc.

    The new facts setup was making '!all' mean no facts at all, since
    it can add/exclude at a finer granularity. Since that makes more
    sense for the ansible collector, and the set of minimal facts to
    collect is really more up to setup.py to decide we do just that.

    So if setup.py needs to always collect some gather_subset, even
    on !all, setup.py needs to have the that subset added to the
    list it passes as minimal_gather_subset.

    This should fix some intg tests that assume '!all' means that
    some facts are still collected (user info and env for example).

    If we want to make setup.py collect a more minimal set, we can do that.

- force facts_dicts.keys() to a list so py3 works
- split fact collector tests to test_collectors.py

- convert Facter(Facts) -> other/facter.py:FacterFactCollector

- add FactCollector.collect_with_namespace()

    regular .collect() will return a dict with the key names
    using the base names ('ip_address', 'service_mgr' etc)

    .collect_with_namespace() will return a dict where the key names
    have been transformed with the collectors namespace, if there is
    one. For most, this means a namespace that adds 'ansible_' to the
    start of the key name.

    For 'FacterFactCollector', the namespace transforms the key to
    'facter_*'.

- add test cases for collect_with_namespace

- move all the concrete 'which facts does setup.py' stuff to setup.py

    The caller of AnsibleFactCollector.from_gather_subset() needs to
    pass in the list of collector classes now.

- update system/setup.py to import all of the fact classes and pass
  in that list.
- split the Distribution fact class up a bit

    extracted the 'distro release' file handling (ie, linux
    boxes with /etc/release, /etc/os-release etc) into its
    own class.
- extract get_cmdline_facts -> cmdline.py
- extract get_public_ssh_host_keys -> system/ssh_pub_keys.py
- extract get_platform_facts -> system/platform.py

  platform.py may be a good candidate for further splitting.

- rm test for plain Facts() base class
- let the base class for Collector unit tests provide collected_facts

    some Collectors and/or their migrated Facts() subsclasses need
    to look at facts collected by other modules ('ansible_architecture'
    the main one...).

    Collector.collect() has the collected_facts arg for this, so add
    a class variable to BaseFactsTest so we can specify it.

- mv Ohai to other/ohai.py and convert to Collector
- update hardware/*.py to return facts (no side effects)

- mv AnsibleFactCollector to setup.py
- extra collector class gathering to module method in
  facts/__init__.py (collector_classes_from_gather_subset)
- add a CollectorMetaDataCollector collector used to provide
  the 'gather_setup' fact
- add unit test module for 'setup' module
  (test/units/modules/system/setup.py)

- Collector init now doesnt need a module, but collect does

    An instance of a FactCollector() isnt tied to a AnsibleModule
    instance, but the collect() method can be, so optionally pass
    in module to FactCollector.collect() (everywhere)

- add a default_collectors for list of default collectors

  import and use it from setup.py module

  eventually, would like to replace this with a plugin loader
  style class finder/loader

- unit tests for module_utils/facts/__init__.py
- add unit tests for ohai facts collector
- remove self.facts side effect on populate() in hardware/sunos.py
- convert OpenBSDHardware() to rm side effects on self.facts
- try to rm some self.facts side effects in Network()

    plumb in collected_facts from populate() where it is needed.

    stop passing collected_facts into Network() [via cached_facts=,
    where it eventually becomes self.facts]

- nothing provides Fact() cached_facts arg now, rm it

    Facts() should be internal only implementation so nothing
    should be using it.

    Of course, now someone will.

- add a Collector.name attr to build a map of name->_fact_ids

    To properly exclude a gather_subset spec like '!hardware', we
    need to know that 'hardware' also means 'devices', 'dmi', etc.
    Before, '!hardware' would remove the 'hardware' collector name
    but not 'devices'. Since both would end up in id_collector_map,
    we would still end up with the HardwareCollector in the collector
    list. End result being that '!hardware' wouldn't stop hardware
    from being collected.

    So we need to be able to build that map, so add the Collector.name
    attribute that is the primary name (like 'hardware') and let
    Collector._fact_ids be the other fact ids that a collector is
    responsible for.

    Construct the aliases_map of Collector.name -> set of _fact_ids
    in fact/__init__.py get_collector_names, and use it when we are
    populating the exclude set.

- refactor of distribution.py

    make the big OS_FAMILY literal a little easier to read
    Also keys can now be any string instead of python literals

    99% sure the test for 'KDE Neon' was wrong
    I don't see how/where it should or could get 'Neon' instead
    of 'KDE Neon' as provided in os-release NAME=

    Use 'distribution' string for key to OS_MAP

    ie, we dont need to make it a valid python label anymore so dont.

    move _has_dist_file to module as _file_exists
    easier to mock without mucking with os.path

    mv platform.system() calls to within get_distribution_facts() instead
    of Distribution() init.

- remove _json compat module

    The code in here was to support:

      -a 'json' python module that was not the standard one included
      with python since 2.6.

      - potentially fallback to simplejson if 'json' was not available.

    'json' is available for all supported python versions now so
    no longer needed.

- mv get_collector_names -> facts.collector
- mv collector_classes_from_gather_subset -> facts.collector
- mv collector tests from test_facts -> test_collector

- Use six's reduce() in sunos/netbsd hardware facts

- rm extraneous get_uname_version in utils

  only system/distribution.py uses it

- Remove Facts() subclass metaclass usage

  - using fact_id and a platform id for matching collectors

    gut most of Facts() subclasses

    rm Facts() subclasses with weird metaclass

    only add collectors that match the fact_ids and the platform_info
    to the list of collectors used.

    atm, a collectors platform_id will default to 'Generic', and
    any platform matches 'Generic'

    goal is to select collector classes including matching the
    systems platform in collector.py, instead of relying on
    metaclasses in hardware/*. To finish this, the various
    Facts() subclasses will need to be replaced entirely with
    Collector() subclasses.

    use collector classmethod platform_match() to match the platform

    This lets the particular class decide if it is compatible with
    a given platform_info. platform_info is a dict like obj, so it could be
    expanded in the future.

    Add a default platform_match to BaseFactCollector that matches
    platform_info['system'] == cls._platform

    They were needed previously to trigger a module
    load on all the collector classes when we import
    facts/hardare so that the Hardware() and related
    classes that used __new__ and find_all_subclasses()
    would work.

    Now that is done in collectors based on platform matching
    at runtime we dont need to do it py module import/parse
    time. So the non empty __init__.pys are no longer needed
    and their is a more flexible mechanism for selection
    platform specific stuff.

    facts/facts.py is no longer used, rm'ed

- if we dont find an implement class for gather spec.. just ignore it.

  Would be useful to add a warn to warn about this case.

- Fix SD-UX typo (should be HP-UX)

- Port fix for #21893 (0 sockets) to this branch

    This readds the change from 8ad182059d
    that got lost in merge/rebase

    Fixes #21893

- port sunos fact locale fix for #24542 to this branch

    based on e558ec19cd

    Fixes #24542

    Solaris fact fix (#24793)

    ensure locale for solaris fact gathering

    fixes issue with locale interfering with proper reading of decimals

- raise exceptions in the air like we just dont care.

    Pretty much ignore any not exit exception in facts
    collection. And add some test cases.

- added new selinux fact to clarify python lib

    the selinux fact is boolean false when the library is not installed,
    a dictionary/hash otherwise, but this is ambigous
    added new fact so we can eventually remove the type dichtomy and normalize it as a dict

    Re-add of devel commit 85c7a7b844 to
    the new code layout, since it got removed in merge/rebase
2017-06-01 11:17:49 -04:00
Trishna Guha
343b83041e nxos_feature fix and unit test (#25200)
* nxos_feature fix

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* nxos_feature unit test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* remove from pep8/legacy-file

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-06-01 08:58:35 +05:30
Dag Wieers
c13b1a718a plugins/terminal/: PEP8 compliancy (#25207)
- Make PEP8 compliant
2017-05-31 18:28:03 +01:00
Chris Alfonso
b937bad52e Narrowing the match for python 3 cmp check (#25220)
Allowing the yaml examples in python documentation.
2017-05-31 17:54:20 +01:00
Dag Wieers
758cfeb73e contrib: PEP8 compliancy (#24680)
- Make PEP8 compliant
2017-05-30 21:08:09 +01:00
Dag Wieers
09ba70f7c4 stat: PEP8, imports, cosmetics (#24653)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
2017-05-30 18:31:56 +01:00
Dag Wieers
8d962209f4 mod_utils/cloudengine: PEP8 compliancy (#24659)
- Make PEP8 compliant
2017-05-30 18:28:02 +01:00
Dag Wieers
b3b11fbce2 get_url: PEP8, imports, cosmetics (#24676)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
2017-05-30 18:24:07 +01:00
Dag Wieers
630185cb20 ansible/executor: PEP8 compliancy (#24695)
- Make PEP8 compliant
2017-05-30 18:13:53 +01:00
Dag Wieers
51b595992b ansible/utils/: PEP8 compliancy (#24686)
- Make PEP8 compliant
2017-05-30 18:09:44 +01:00
Dag Wieers
47738eb1dd docs: PEP8 compliance (#24681)
- Make PEP8 compliant
2017-05-30 18:08:25 +01:00
Dag Wieers
4efec414e7 test/: PEP8 compliancy (#24803)
* test/: PEP8 compliancy

- Make PEP8 compliant

* Python3 chokes on casting int to bytes (#24952)

But if we tell the formatter that the var is a number, it works
2017-05-30 18:05:19 +01:00
Trishna Guha
31c59ad5f9 nxos_portchannel fix and unit test (#25019)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-05-30 21:22:24 +05:30