Commit Graph

357 Commits (eb33cc88bdaee747a36d583ec7523d3493899a33)

Author SHA1 Message Date
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)
7 years ago
Pierre-Louis Bonicoli c52f355bcb serverless: fix broken import 7 years ago
Pierre-Louis Bonicoli f761fc1d1f rhn_channel: fix py3 compatibility (use six)
and remove unused import
7 years ago
Pilou feff6abd72 os_client_config: fix broken import (#26839)
* os_client_config: fix broken import
* remove wildcards and add boilerplate
7 years ago
Toshio Kuratomi 7cd81b802d Fix wildcard imports, remove get_exception, add boilerplate
Fixed for monitoring modules
7 years ago
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
7 years ago
Toshio Kuratomi ac56a2f138 Remove wildcard imports and get_exception calls
Fixed module_utils
7 years ago
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
7 years ago
Abhijeet Kasurde f7321a87ca Pep8 fixes for rabbitmq modules (#24590)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Dag Wieers eee09565b1 utilities modules: PEP8 compliancy (#27741) 7 years ago
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.
7 years ago
Nathaniel Case 01dda25e0f fix nxapi transport in nxos_snmp_location (#27849)
* fix nxapi transport in nxos_snmp_location

* Appease Shippable
7 years ago
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
7 years ago
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.
7 years ago
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.
7 years ago
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)
7 years ago
Nathaniel Case b9e80b6117 nxos_vrf_interface cleanup (#27642)
* Update RETURN, results, & execute_show_command
7 years ago
René Moser fdaa803cca cloudstack: cs_vmsnapshot: fix pep8 (#27792) 7 years ago
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.
7 years ago
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
7 years ago
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
7 years ago
Dag Wieers 0342760f5b sefcontext: PEP8 compliancy (#27742) 7 years ago
René Moser 5700b09610 cloudstack: new module cs_instance_nic_secondaryip, replaces cs_nic (#26491) 7 years ago
Dag Wieers a34ef12d73 hpilo modules: PEP8 fixes (#27739) 7 years ago
Dag Wieers bcb3e33adb command: PEP8 compliancy (#27740) 7 years ago
Toshio Kuratomi fbf6cb8fff Add boilerplate to fetch.py
This completes the modules/files directory so we can now check it for
regressions.
7 years ago
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
7 years ago
Pierre-Louis Bonicoli 33e8c83fde vca_nat: 'import' test is successful 7 years ago
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>
7 years ago
Jordan Borean 8bb10bb225 removed requirements on WANT_JSON and POWERSHELL_COMMON (#27679) 7 years ago
Abhijeet Kasurde 5e2184c683 Fixing broken imports and get_exception for ipa
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
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`
7 years ago
Robin Roth b134352d8c WIP: Replace boilerplate (#27554)
* Replace boilerplate

* Enable test on packaging/os
7 years ago
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
7 years ago
Pilou 49b8bd0358 Fix broken import in utilities.helper._accelerate (#27088)
* Fix py3 compatibility using six.moves.socketserver

* Remove useless call to str
7 years ago
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
7 years ago
Toshio Kuratomi 4109a82d0a remove wildcards and add boilerplate
* cloud/centurylink
* source_control
* cloud/google
* notification
* cloud/rackspace
* cloud/vmware
7 years ago
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
7 years ago
Toshio Kuratomi 0765ceb66d revise ordered list of boilerplate work 7 years ago
Toshio Kuratomi 8de6cff2b1 more wildcards 7 years ago
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
7 years ago
Toshio Kuratomi 6f69cd4501 Add code to allow from __future__ in docs-only modules 7 years ago
Toshio Kuratomi 8b7db55a94 Modify boilerplate code-smell test to check some of the module dirs 7 years ago
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)
7 years ago
Yanis Guenane 9e41fd399b Removing openssl_publickey from pep8 legacy files (#27414) 7 years ago
Toshio Kuratomi 30a688d8d3 Update conventions in azure modules
* Remove wildcard imports
* Update GPL header to the one-line form
* Add from __future__ imports
7 years ago
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
7 years ago
David Newswanger 81151ef02c Remove Deprecated Template network modules (#27076)
* removed deprecated networking template modules

* update changelog

* update changelog
7 years ago
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>
7 years ago
Abhijeet Kasurde b2d609b6f1 Add testcase for ipify_facts (#26421)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago