Commit Graph

103 Commits (ac992eff1c43ce3ad6b790f1b8dd22b9b0192ec8)

Author SHA1 Message Date
mjfroehlich cc50b803df [cloud][route53_health_check] Consider port in identity test (#22762)
Allows to health-check two services on one host. Before, asking for 2 health checks being present for `http://myhost:8888` and `http://myhost:9999`  resulted in just a single health check, as this module considered the two specs as equal.

Bonus: route53_health_check now passes style guidelines
8 years ago
Matt Martz 02f66b9369 E1 legacy pep8 fixes (#21933)
* E1 pep8 fixes

* e111 fix for rds.py
8 years ago
Sloane Hertel 4749b75090 [cloud] ec2_eni: don't modify a network interface without eni_id - fixes #22401 (#22689)
* don't modify an eni without eni_id

fix pep8

remove ec2_eni from pep8 legacy files

remove a couple unused variables in main()

fix the documentation

* fix yaml
8 years ago
Sloane Hertel 8ccde6fbb0 [cloud] make docs for ec2_group rules more clear (#22701)
make ec2_group pep8

removed ec2_group from pep8 legacy files
8 years ago
Sloane Hertel a4552c11b3 allow groups parameter to be noticed as an empty list (#22707)
make iam.py pep8

remove iam.py from pep8 legacy files
8 years ago
Ryan Brown d791665559 fix validate-module sanity error per https://app.shippable.com/github/ansible/ansible/runs/16493/1/console (#22711) 8 years ago
Matt Clay 672e9a2f61 Fix module validation without base branch. 8 years ago
Matt Clay 1f337b6421 Support module alias and rename validation. (#22675)
Cache git ls-tree output to speed up validation.
8 years ago
Sloane Hertel 3aef028d42 [cloud] make ec2 module pep8 (#22421)
* making ec2 pep8

* remove ec2 from pep8 legacy files

* missed a couple

* fix imports and remove iteritems

* making group_id and group_name mutually exclusive and fixing whitespace
8 years ago
Toshio Kuratomi eb1214baad New metadata 1.0 (#22587)
Changes to the metadata format were approved here:
https://github.com/ansible/proposals/issues/54
* Update documentation to the new metadata format
* Changes to metadata-tool to account for new metadata
  * Add GPL license header
  * Add upgrade subcommand to upgrade metadata version
  * Change default metadata to the new format
  * Fix exclusion of non-modules from the metadata report
* Fix ansible-doc for new module metadata
* Exclude metadata version from ansible-doc output
* Fix website docs generation for the new metadata
* Update metadata schema in valiate-modules test
* Update the metadata in all modules to the new version
8 years ago
John R Barker 04e816e13b Stricter module documentation validation (#22353)
Raise the bar for module `DOCUMENTAION`
This validator update was used to find the issues in https://github.com/ansible/ansible/pull/22297/files

**Validation**
* Updated Validation and docs to enforce more (items fixed in https://github.com/ansible/ansible/pull/22297/files)
* Use `suboptions` to document complex options 
* Validate module name
* Validate deprecated modules have correct ANSIBLE_METADATA

**Module Documentation Generation**
* Document `suboptions:` Example https://gist.github.com/gundalow/4bdc3669d696268328ccc18528cc6718
* Tidy up HTML generation (valid HTML, no empty lists, etc)
 
**Documentation**
* Clarify the steps for deprecating a module
* Use correct RST headings
* Document `suboptions:` (options)
* Document `contains:` (returns)


**Details**
The aim is to get this (and corresponding module updates) complete by the time `devel` becomes `2.4`, as this allows us to raise the bar for new modules

Example `suboptions` https://gist.github.com/gundalow/4bdc3669d696268328ccc18528cc6718

The aim is to get this PR integrated into `devel` *before* we branch `stable-2.3`, this will allows us to:
* Raise the bar for new modules in 2.4
* Ensure the generated module documentation for 2.3 and higher is improved, important as we will be doing versioned docs moving forward.
8 years ago
René Moser e0d38fb137 composer: fix escape working_dir (#22363)
* composer: fix escaping of path working_dir

* composer: fix pep8
8 years ago
Lujeni d942196666 Use a dedicated directory for the mongodb modules (#22187)
* Use a dedicated directory for the mongodb modules
* Missing the RETURN documentation in mongodb_user
8 years ago
René Moser c1730c21ce cloudstack: cs_sshkeypair: fix fingerprint not used as identifier (#22276)
* cloudstack: cs_sshkeypair: fix fingerprint not used as identifier

* remove from legacy

* fix for 2 keys, one with name and one with fingerprint
8 years ago
Matt Clay 673bfc06b9 Support option renaming in validate-modules. 8 years ago
Matt Martz 293e624235 Support matching original path for a moved module location 8 years ago
Matt Martz 958ce4a252 Create custom JSONEncoder to stringify Exceptions 8 years ago
James Cammarata a2599cab79 Fix variable precedence of INI/script vars to be in-line with docs.
This commit also adds a new test script (ansible-var-precedence-check.py in code-smell/)
to provide us with another line of defense against precedence bugs going forward.

The precedence docs state that the INI vars have a lower precedence than group/host
vars files for inventory and playbooks, however that has not been the case since 2.0
was released. This change fixes that in one way, though not exactly as the docs say.
The rules are:

1) INI/script < inventory dir < playbook dir
2) "all" group vars < other group_vars < host_vars

So the new order will be (from the test script mentioned above):

8. pb_host_vars_file - var in playbook/host_vars/host
9. ini_host_vars_file - var in inventory/host_vars/host
10. ini_host - host var inside the ini
11. pb_group_vars_file_child - var in playbook/group_vars/child
12. ini_group_vars_file_child - var in inventory/group_vars/child
13. pb_group_vars_file_parent - var in playbook/group_vars/parent
14. ini_group_vars_file_parent - var in inventory/group_vars/parent
15. pb_group_vars_file_all - var in playbook/group_vars/all
16. ini_group_vars_file_all - var in inventory/group_vars/all
17. ini_child - child group var inside the ini
18. ini_parent - parent group var inside the ini
19. ini_all - all group var inside the ini

Fixes #21845
8 years ago
Matt Clay d66ce40ecb Overhaul `ansible-test sanity` implementation. (#22177)
- Tests are run to completion instead of stopping on first failure.
- Test results are now parsed instead of passing through to the console.
- Test results can be saved in junit xml format.
- Test results will show up on the Shippable "Tests" result tab.
- Added an experimental --lint option for easier integration with other tools.
- Code smell tests are now usable with the --list-tests, --test and --skip-test options.
- Code split out from executor.py into sanity.py.
- Rename download-logs to download.py and add support for test and coverage results.
- Miscellaneous improvements.
8 years ago
Matt Martz f761949cca Ensure that a deprecated module has DOCUMENTATION.deprecated (#22090) 8 years ago
Matt Clay 45cec93e99 Disable newer shellcheck tests which don't pass. 8 years ago
Slezhuk Evgeniy e12daee5eb jira: comply with current pep8 rule set 8 years ago
Will Thames ebfc7bac94 cloudfront_facts module improvements
* Make more use of AWS Exception information
* Use pythonic dict assignments
* Improve documentation formatting to make option names clearer
  in descriptions
* Meet ansible line length requirements
* Tidy up flake8 messages
8 years ago
René Moser 06acf8ac2e nginx_status_facts: fix pep8 (#21963)
* nginx_status_facts: fix pep8

* remove from legacy files
8 years ago
René Moser d26c57f938 exoscale: pep8 and python3 fixes (#21821)
* exoscale: pep8 fixes

* exo_dns_record: remove from pep8 test legacy

* exoscale: fix python3 support
8 years ago
Matt Martz 305c88700d PEP8 E712 fixes (#21916) 8 years ago
Matt Clay c448a418fd Treat deprecated modules as old during validation. 8 years ago
Matt Martz 97e12b0898 Check for imports to be between last doc line and first callable (#21863)
* Check for imports to be between last doc line and first callable

* Small readme update
8 years ago
Dag Wieers b1f6344ecb win_chocolatey: Clean up parameter handling (#21533)
Changes include:

- Use Get-AnsibleParam with -type/-validateset
- Replace $result PSObject with normal hash
- Deprecate 'upgrade' parameter by using state=latest
8 years ago
Matt Martz 36e6c7973d pep8 fixes for module_docs_fragments (#21876) 8 years ago
Matt Martz 4b320ce0e4 Add checks for from module_utils import * (#21800) 8 years ago
Matt Clay cba91c7f44 Test placement (#21801)
* Fix test placement and update messaging.
* Add note about group selection.
8 years ago
Matt Clay b5e0eb0985 Fixes for missing aliases files sanity test. (#21798)
* Refine test for missing aliases files.
* Fix formatting of missing aliases message.
8 years ago
Toshio Kuratomi 45251f910c Make BaseFileCache into an abstractbaseclass so it's a proper interface
Push the opening and closing of files into the _load and _dump methods
so that we don't invoke the slow codec machinery without reason.
8 years ago
Brian Coca 374af06cbf added pickle and yaml cache plugins
added new base class for file based cache plugins as 99% of code was common
now also catches unexpected decoding exceptions
allows per module file modes and encoding
moved jsonfile code to base
8 years ago
Matt Martz b143fdea54 DOC options must be a dict when used with extends_documentation_fragment (#21745)
* Fix string formatting
* Provide better tracebacks
* When options is None and extends_documentation_fragment is in use, add an error that options must be a dict
* If options was specified and not a dict, then error
8 years ago
Veaceslav Mindru cdcdc1d81b #19587 add yum skip-broken (#21475)
* #19587: refactor to PEP8

* Issue: #19587: add skip_broken option to yum module
PNTSYSOPS-1901 - internal reference

Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>

* Issue: #19587: fix line break, attempt to make readble

        things at line 646 look ugly ..
        trying to make them look a bit more human readble
        though the entire approach should be rewriten

PNTSYSOPS-1901 - internal reference

Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>

* #19587: fixing typo, skip-broken has to be passed as list

* PR: #21475: peer review changes
            relates to: revert comment deletion https://github.com/ansible/ansible/pull/21475#discussion_r101574146
            relates to: remove irelevant var https://github.com/ansible/ansible/pull/21475#discussion_r101573388
            relates to: reformat https://github.com/ansible/ansible/pull/21475#discussion_r101572840

Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>

* PR: #21475: peer review changes
            relates to: https://github.com/ansible/ansible/pull/21475#discussion_r101573736

Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>

* Issue: #21475: fixing typo in the Man section

Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>

* PR: #21475 - Peer review: revert variable a
        Relates to: https://github.com/ansible/ansible/pull/21475#pullrequestreview-22404868

Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>

* Issue: 19587 - small correction

Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>
8 years ago
Matt Martz c160ede789 Validate modules json output (#21680) 8 years ago
Matt Martz 9b1bd2eb7e Re-enable module comparisons in validate-modules (#21582)
* Re-enable module comparisons, specifically for new module detection and for finding new options/arguments
* Only do new module checks in shippable, local will display warning
8 years ago
Toshio Kuratomi eeaec56ed5 Use isinstance instead of type() comparisons. isinstance is more robust 8 years ago
Will Thames f42ffe6de3 [cloud] Ensure that s3_bucket module always enables/disables versioning if it is specified (#21320)
If versioning is not enabled, then `get_bucket_versioning`
can return an empty dict.

If that happens, the code to enable versioning should still
run!

The logic for suspending versioning was also incorrect, so
have updated that too.

Fixes #20491
8 years ago
Matt Martz 7c00346714 Validate EXAMPLES as YAML 8 years ago
Will Thames 103ede26df Ensure ssh hostkey checks respect server port (#20840)
* Add tests for `get_fqdn_and_port` method.

Currently tests verify original behavior - returning default `ssh-keyscan` port
Add test around `add_host_key` to verify underlying command arguments
Add some new expectations for `get_fqdn_and_port`
Test that non-standard port is passed to `ssh-keyscan` command

* Ensure ssh hostkey checks respect server port

ssh-keyscan will default to getting the host key for port 22.
If the ssh service is running on a different port, ssh-keyscan
will need to know this.

Tidy up minor flake8 issues

* Update known_hosts tests for port being None

Ensure that git urls don't try and set port when a path
is specified

Update known_hosts tests to meet flake8

* Fix stdin swap context for test_known_hosts

Move test_known_hosts from under basic, as it is its own library.
Remove module_utils.known_hosts from pep8 legacy files list
8 years ago
Tim Rupp 2a9778e320 Change the f5 modules to use f5_utils file (#21466)
The f5 module utils were using a file name that appeared to
conflict with the f5 python SDK's namespace. This patch just changes
the name of the included class to be f5_utils to avoid the issue
of namespace collisions
8 years ago
John R Barker 53ac312382 validate-modules --arg-spec (#21331)
* validate-modules --arg-spec

* Update developing_modules_documenting.rst

* Never mock out ansible or ansible.module_utils

* No more false positives
8 years ago
Matt Clay d54bc09fae Consider module_utils deps when running tests. (#21382)
* Skip pep8 analysis when --explain is used.
* Fix return type annotations.
* Match line length requirement of PEP 8 config.
* Consider module_utils deps when running tests.
8 years ago
Ted Timmons 23886c5c0d add instructions for running pep8 locally (#21120) 8 years ago
Matt Martz 87aa59af79 Legacy pep8 updates for setup.py and tests 8 years ago
s-hertel 2dc42fce80 [cloud] add tags parameter to `ec2_vol` & PEP8 fixes (#21254)
* Make ec2_vol pep8 and add tags parameter

* Remove ec2_vol.py from pep8 legacy-files
8 years ago
Matt Clay 46f9648aa1 Fix type() usage check in validate-modules.
This avoids false positives when 'if' or 'or' are in a string
preceding the use of type() on the same line.
8 years ago