Commit Graph

2797 Commits (85bb804cdabad48842b44d85ee0a6a6f18e0c3a3)

Author SHA1 Message Date
Jordan Borean 79fff7da69
Expose to_<str> as a public function (#68965)
* Expose to_<str> as a public function

* Fix sanity checks

* Move docstring to start of util
4 years ago
Brian Coca ac509d489b
Revert "stricter permissions on atomic_move when creating new file (#68970)" (#68983)
This reverts commit 566f2467f6.
4 years ago
Brian Coca 566f2467f6
stricter permissions on atomic_move when creating new file (#68970)
fixes #67794
  updated some tests that expected previous defaults
  CVE-2020-1736
4 years ago
Jordan Borean 702949e64c
windows - fix up env var quoting for unicode single quotes (#68968)
* windows - fix up env var quoting for unicode single quotes

* Add sanity ignore check for smart quotes
4 years ago
David Shrewsbury 18a66e291d
Force collections to be static (#68723)
* Force collections to be static

Templating of collection names does not work at all. Force them to
be static so that a warning is generated for the user.

* Add collectionsearch unit test and fix for reviews

New unit test validates the new _load_collections() code and moves
the new check to the end of the method.

* Change unit test to pytest

* Adjust unit test to use capsys instead of monkeypatch

* Fix pep8 error

* Add changelog fragment

Closes #68704
4 years ago
Zhanwei Wang 1097694355
get_url pass incorrect If-Modified-Since header(#67417) (#67419)
Fix #67417. HTTP header value of `If-Modified-Since` set by `get_url` does not follow HTTP protocol.
5 years ago
Toshio Kuratomi 184f540056 Add some more unittests for fail_json
Test that order of msg as a keyword arg doesn't matter
5 years ago
Toshio Kuratomi 6531ba38f8 Allow the msg argument to fail_json() to be a positional argument
fial_json() requires a message be given to it to inform the end user of
why the module failed.  Prior to this commit, the message had to be a
keyword argument:

    module.fail_json(msg='Failed due to error')

Since this is a required parameter, this commit allows the message to be
given as a positional argument instead:

   module.fail_json('Failed due to an error')
5 years ago
Jordan Borean a20a527014
ansible-galaxy - Fix tar path traversal issue during install - CVE-2020-10691 (#68596) 5 years ago
Graham Mainwaring 2068131589
Fix colorization to not extend across newline boundary (#68517)
* Fix colorization to not extend across newline boundary

* Fix unit test to look for the newline outside the coloration

* Add changelog fragment
5 years ago
Rick Elrod 3c3ffc09c2
Fix and add tests for some module_utils.common.validation (#67771)
* Fix test_check_mutually_exclusive exception-checking

Asserting inside of the `with` context of `pytest.raises`
doesn't actually have any effect. So we move the assert
out, using the exception that gets placed into the scope
after we leave the context, and ensure that it actually gets
checked.

This is also what the pytest documentation says to do:
https://docs.pytest.org/en/latest/assert.html#assertions-about-expected-exceptions

Signed-off-by: Rick Elrod <rick@elrod.me>

* Add some tests for check_required_together

Signed-off-by: Rick Elrod <rick@elrod.me>

* use to_native instead of str, for consistency

Signed-off-by: Rick Elrod <rick@elrod.me>

* Add newlines for pep8

Signed-off-by: Rick Elrod <rick@elrod.me>

* Add tests for check_required_arguments

Signed-off-by: Rick Elrod <rick@elrod.me>

* Sort missing keys in error message, since hashes are unsorted and this can be random

Signed-off-by: Rick Elrod <rick@elrod.me>

* Add changelog entry

Signed-off-by: Rick Elrod <rick@elrod.me>
5 years ago
Jordan Borean 127d54b363
galaxy - preserve mode properly on artifact (#68418)
* galaxy - preserve mode properly on artifact

* Fix py2 encoding issue

* Update lib/ansible/galaxy/collection.py

Co-Authored-By: Matt Clay <matt@mystile.com>

* Use sane defaults instead of sourcing from tarfile

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Martz d3ec31f8d5
Support pre-releases via new SemanticVersion (#68258)
* Support pre-releases via new SemanticVersion. Fixes #64905

* Don't treat buildmeta as prerelease

* Don't inherit from str and int

* Add helper method to try and construct a SemanticVersion from a LooseVersion

* Don't count major 0 as pre-release, it's different

* Guard against invalid or no version in LooseVersion

* return a bool

* Add integration tests for pre-release

* Fix up lingering issues with comparisons

* typo fix

* Always allow pre-releases in verify

* Move pre-release filtering into CollectionRequirement, add messaging when a collection only contains pre-releases

* Update changelog

* If explicit requirement allow pre releases

* Enable pre-releases for tar installs, and collections already installed when they are pre-releases

* Drop --pre-release alias, make arg name more clear

* Simplify code into a single line

* Remove build metadata precedence, add some comments, and is_stable helper

* Improve from_loose_version

* Increase test coverage

* linting fix

* Update changelog
5 years ago
Matt Clay 2dd9c479dc Remove unnecessary unit test requirements. 5 years ago
Matt Clay 7e8dae5790 Remove unused unit test files. 5 years ago
Ansible Core Team e0e57b4beb migration final cleanup 5 years ago
Ansible Core Team cc2feea51b Migrated to vyos.vyos 5 years ago
Ansible Core Team 40714dfca9 Migrated to openvswitch.openvswitch 5 years ago
Ansible Core Team 36a545553e Migrated to dellemc_networking.os6 5 years ago
Ansible Core Team bc40fe0b6f Migrated to dellemc_networking.os9 5 years ago
Ansible Core Team 0b633b3703 Migrated to dellemc_networking.os10 5 years ago
Ansible Core Team 35063de590 Migrated to junipernetworks.junos 5 years ago
Ansible Core Team 8ee0187388 Migrated to openstack.cloud 5 years ago
Ansible Core Team 6ce86295c0 Migrated to f5networks.f5_modules 5 years ago
Ansible Core Team 3149db0869 Migrated to cisco.nxos 5 years ago
Ansible Core Team 8a3f3e41f8 Migrated to cisco.meraki 5 years ago
Ansible Core Team 5aa37733c3 Migrated to cisco.iosxr 5 years ago
Ansible Core Team 7e04b5ba8b Migrated to cisco.ios 5 years ago
Ansible Core Team ab5a3b4305 Migrated to cisco.asa 5 years ago
Ansible Core Team 3f1cea89fb Migrated to cisco.aci 5 years ago
Ansible Core Team 14b0ab63ac Migrated to arista.eos 5 years ago
Ansible Core Team 6da1ec1d8c Migrated to check_point.mgmt 5 years ago
Ansible Core Team f0cf2c159b Migrated to netapp.ontap 5 years ago
Ansible Core Team cae9d633b0 Migrated to netapp.elementsw 5 years ago
Ansible Core Team 0a9205b7c0 Migrated to netapp.aws 5 years ago
Ansible Core Team bdd82adf61 Migrated to netbox.netbox 5 years ago
Ansible Core Team 09d8d46983 Migrated to fortinet.fortios 5 years ago
Ansible Core Team 48d4e9370e Migrated to ansible.windows 5 years ago
Ansible Core Team 829eb0f1d1 Migrated to ansible.posix 5 years ago
Ansible Core Team 9a7a574ffc Migrated to ansible.netcommon 5 years ago
Ansible Core Team 6d910034a0 Migrated to ansible.amazon 5 years ago
Ansible Core Team bb3494356a Migrated to community.windows 5 years ago
Ansible Core Team 40218535ee Migrated to community.vmware 5 years ago
Ansible Core Team 0ed8af9021 Migrated to community.crypto 5 years ago
Ansible Core Team 4e488d8435 Migrated to community.general 5 years ago
Ansible Core Team 58e8a91f4d Migrated to community.amazon 5 years ago
Ansible Core Team 32bf1b8115 Migrated to frr.frr 5 years ago
Rick Elrod 21dfec6c4f make test_raw use setUp instead of global definitions
Signed-off-by: Rick Elrod <rick@elrod.me>
5 years ago
Matt Clay 2c0be65f44
Relocate netbox module_utils unit tests. (#68056)
* Relocate netbox module_utils unit tests.

This puts them where migration expects them.

* Update sanity ignores.
5 years ago
Rick Elrod 65edd5e37f Split test_connection into individual files
Signed-off-by: Rick Elrod <rick@elrod.me>
5 years ago