Commit Graph

8329 Commits (87601969a3a9d9c793d3af6574aef0e8c15932c6)

Author SHA1 Message Date
Toshio Kuratomi 87601969a3 Correct places where match was intended
pytest.raises has two parameters, message and match.  message is meant
to be the error message that pytest gives when the tested code does not
raise the expected exception.  match is the string that pytest expects
to be a match for the repr of the exception.  Unfortunately, it seems
that message is often mistakenly used where match is meant.  Fix those
cases.

message is also deprecated so removed our usage of it.  Perhaps we
should write a sanity test later that prevents the use of
pytest.raises(message) to avoid this mistake.

seealso: https://docs.pytest.org/en/4.6-maintenance/deprecations.html#message-parameter-of-pytest-raises

Also update the exception message tested for as we're now properly
detecting that the messages have changed.
5 years ago
Aljaž Košir 42073b6331 Add lambda_bucket_event module (#58059) 5 years ago
Jill R 1c1da3c11d
Re-enable ec2_vpc_vpn_facts test (#58893) 5 years ago
pratikgadiya12 393e4a41d0 Added support to create and delete multiple databases in MySQL (#58602)
* Added support to create/delete mulitiple databases in MySQL

Fixes: #58370

* Added additional tests cases and fixed documentation changes

* Code refactoring and added tests for better test coverage

- Removed db_exists usage from most of the code. Used existence_list
 and non_existence_list instead

- Added additional tests to cover all scenarios w.r.t creation and deletion
 on multiple databases

- Added tests for dump operations

* Minor fix

* Minor fix - create check mode test

* Added dump tests for better dump tests coverage

* Removed minor database connection details

* fixed error

* Added test case for import operations

* Code refactoring and review fixes

- Added dump all test case

* Fixed review comments

* Minor review comment fixes

* Altered db_create return value

* Removed db_list and altered "does exist" to just "exist"

* Kept db and db_list in module.exit_json

* Refactored tests

- Added removal of dump2 file

* Moved import tests to state_dump_import file

* Removed import tests from multi_db_create_delete

* Updated porting guide, added RETURN block

* Minor identation fix

* Added validation to check if databases are dumped
5 years ago
Hannes Ljungberg 0e8eb1d17f pip: Remove unused option use_mirrors and remove all ignore.txt entries
PR #58977

* Remove unused option use_mirrors

* Add changelog fragment
5 years ago
Sam Doran d2edf1d435 User - Create parent directories if they do not exist in the specified home path (#51043)
* Create a user home directory if it has parents that do not exist

The useradd command line tool does not create parent directories. Check if the specified home path has parents that do not exist. If so, create them prior to running useradd, then set the proper permission on the created directory.

Add tests

Signed-off-by: Sam Doran <sdoran@redhat.com>

* Use dict for default user group in tests

Signed-off-by: Sam Doran <sdoran@redhat.com>

* Fix tests

Signed-off-by: Sam Doran <sdoran@redhat.com>
5 years ago
Sumit Jaiswal b01b1d40cf
PR to add Unit TC for Checkpoint network module (#57710)
* cp_network unit TC

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
5 years ago
Yunge Zhu cb201bfba1 add xmltodict to azure requirements file (#55748)
* add xmltodict

* fix lint
5 years ago
Sebastiaan Mannem d0538c0d7a postgresql_pg_hba: Exception when two lines with same weight are compared (#59198) 5 years ago
Abhijeet Kasurde 8a13b41823
VMware: Use managed object id to find VM (#59143)
* Based upon partial work of wilmardo
* Now, user can specify managed object id of virtual machine to find
an existing virtual machine

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Yunge Zhu 42c43a2822 add azure_rm_keyvaultkey_info module (#55754) 5 years ago
Matt Clay 13bbfacb04 Show ansible-test --explain errors in CI. 5 years ago
Andrey Klychkov 0e09800a9a Postgresql modules: tidying up of CI tests (#59099) 5 years ago
Brian Coca a39b721db5
fixes to config manager (#58530)
* skip unreadable ansible.cfg

* all types should check for type

* patch access for tests and fix tests that relied on missing files not being checked
5 years ago
dx0xm b8eba8e1f0 VMware: Add testcase for vmware_dvs_portgroup_facts (#59088)
* Tests for choosing specific DVS while gathering facts

Signed-off-by: dx0xm <52723266+dx0xm@users.noreply.github.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Hannes Ljungberg 6f94995b52 npm: Validate all option types (#58965)
* Add type validation for name, version and registry
* Add changelog fragment
* Remove ignore of E337 and E338
5 years ago
Matt Davis d28f25d118
patch ansible-connection collection plugin loading (#59119) 5 years ago
Matt Clay d4dec59cb0 Fix collection loader builtin handling. (#58897)
- Support more import statements:

  from ansible_collections.ansible.builtin.plugins.module_utils import basic
  from ansible_collections.ansible.builtin.plugins.module_utils.basic import AnsibleModule

- Add unit tests for more import statements.
- Raise ImportError instead of returning None if load_module fails.
5 years ago
Toshio Kuratomi 019d078a5a
Move common build code from _build_helpers (#55986)
We have some common code used by several docs scripts.  Migrate that
into the build-only shared code repository.

* Move lib/ansible/utils/_build_helpers.py to the directory for common
  build code
* Migrate docs/bin/dump_config.py to a build-ansible subcommand
* Migrate dump_keywords to the build-ansible framework
  * Make the script more maintainable by using functions and good
    variable names
  * Port to Python3 idioms
  * Fix bug so that private attributes will be undocumented
* Move generate_man to a build-ansible subcommand
* Port plugin_formatter to a build-ansible subcommand
* Rework command_plugins so that docs scripts can target Python-3.4+ and
  releng-only subcommands can use more recent versions of Python.
  The architecture is now that command_plugins/* need to be importable
  on Python-3.4.  The init_parsers() method needs to run on Python-3.4.
  But the main() method can utilize features of more recent Python as
  long as it fits within those parameters.
* Update docs build requirements

Port the plugin_formatter to build-ansible framework
5 years ago
Matt Clay cb0dfc9793 Prepare pylint test for collections support. 5 years ago
Chris Archibald 8bf069114f New Module: Vscan Enable (#57953)
* new module

* fix netapp.py

* updates

* fixes
5 years ago
Sam Doran d17e7a91b1
Add test for meta: end_play (#59118)
- Set ansible_python_interpreter for hosts using local connection
5 years ago
Wojciech Sciesinski e8a7d89180 Correct a documentation of the jenkins_plugin module (#59139) 5 years ago
Matt Clay 2ed78b650f Update to ansible-test to prepare for collections.
Changes to simplify merging of collections support.
5 years ago
Abhijeet Kasurde de66abe521
VMware: Add support for storagePod (#58627)
* User now can be specify datastore cluster for deploying OVF
* Added find_resource_pool_by_cluster API

Fixes: #57849

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Matt Clay 4b9391f32a Clean up ansible-test target handling. 5 years ago
Matt Clay 4255ee8e5a Prepare ansible-test for collections support.
Another round of changes to prepare ansible-test for supporting collections to help keep later PRs a manageable size.
5 years ago
Matt Clay f81238012b Clean up pylint issues in test infra. 5 years ago
Martin Krizek 4898b0a4a2 group: detect duplicate GIDs when local=yes (#58469) 5 years ago
Alvaro Olmedo Rodriguez a1dcba63b3 java_keystore - Prefer SHA256 and solve SHA256 keytool in java11 version (#57302) 5 years ago
Andrey Klychkov 2a07123fdd jboss module: add check mode support and integration tests (#58959)
* git war file and wildfly archive from S3
* create setup_wildfly_server role for integration tests
5 years ago
Noe Gonzalez 3a5d13b0d7 VMware: Fix vmware_guest cloning bug (#58737)
* fix vmware_guest cloning bug
* added tests for resizing disks during clone
5 years ago
n3pjk a135c483ce Add OAuth and Multi-Record Query for SNOW (#58410)
* Add SNOW OAuth Support and Multi-record Query

* Add OAuth documentation to snow_record_find

* Fix lint and verification issue for PR 58410

* Fix E309 and E324 errors in PR 58410

* Fix E307, need advice on E309

* Fix E309 for PR 58410

* Re-add instance, username and password documentation

* Fix data type mismatch in documentation

* Remove doc_fragment overlap

* Refactor service now module space

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Matt Clay d910c971b4
Minor ansible-test code cleanup. (#59052)
* Minor ansible-test code cleanup.
* Fix type annotations.
5 years ago
The Magician d1587bca41 Bug fixes for GCP modules (#58902) 5 years ago
Chris Archibald f3aac3a112 MOTD was not idempotent (#57372)
* fix issue

* fix issues

* fix issues

* fix issues
5 years ago
The Magician 51e1b090db Bug fixes for GCP modules (#58901) 5 years ago
The Magician 119b8521a6 Bug fixes for GCP modules (#58904) 5 years ago
Matt Clay 6645054329
Code cleanup for test infrastructure. (#59046)
* Remove useless object inheritance in test code.
* Remove unnecessary pass statements from test code.
* Comment on why certain pylint rules are ignored.
* Add more pylint test contexts.
* Fix import order.
* Remove unused variables.
* Remove unnecessary pass statement.
* Fix bad continuations.
* Remove unnecessary elif.
* Allow legitimate broad except statements.
* Allow legitimate protected access.
* Clean up names to make pylint pass.
5 years ago
Toshio Kuratomi dd2755e0b4 Fix pylint warnings for update-bundled 5 years ago
The Magician 6fb7a2b7cc Bug fixes for GCP modules (#58903) 5 years ago
The Magician 5cd0e2f19f Bug fixes for GCP modules (#58900) 5 years ago
Ganesh Nalawade 70db07fa82 Fix junos_interfaces integration test failure (#59035)
* Fix junos_interfaces failure

*  Remove lo0 interface by default since
   vsrz zuul env seems to add it intermittently
   as part of device intial config

* Add missing change for replace case
5 years ago
Pavan Bidkar 7b8edbf9dd VMWare: New Module for content library CRUD operations (#58716) 5 years ago
Matt Clay 3f2b766d10 Add future and metaclass boilerplate to test code.
Continue to ignore:

- test/integration/
- test/legacy/
- test/units/
5 years ago
Gonéri Le Bouder f98a4ef2f7 vmware: ro=False datastores for the functional test
https://github.com/ansible/ansible/issues/58541 prevents us from using
read-only datastore. So for now, we mount everything read-write.
5 years ago
Pavan Bidkar 6bd6bf98e5 VMware: New Module for VMWare content Library info (#58703)
* Changes as per review comments and renamed file to vmware_content_library_info
* Removing password field from publish info dictionary
* Removed current password field from publish info
* Modified vmware_content_library_info module with review comments.
* Review comments. Moved test .yml files under tasks folder
* Moved test files under module name folder. Handled library_get call under try catch to throw proper error message
* Fixed precheck failure bare except. Catching Exception
5 years ago
Gonéri Le Bouder 31baab85f9 ansible-test: vcenter through a HTTP proxy
Give the ansible-test user the ability to target a lab behind a HTTP proxy.
5 years ago
Abhijeet Kasurde 617972499f
VMware: Correct network_exists_by_name API call (#59006)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Ganesh Nalawade f09bd91ad0
Add junos_interfaces resource module (#58871)
* Add junos_interfaces resource module [junos_interfaces]

*  Add new resource module junos_interfaces.
*  Targets model https://github.com/ansible-network/resource_module_models/pull/8
*  Depcreate junos_interface module

* Fix CI failures

* Fix integration test failures

* Fix CI failures

* Fix review comments
5 years ago