Commit Graph

2065 Commits (635e3fe9ee84bea9788f14fe911ec4ec35489e49)

Author SHA1 Message Date
Toshio Kuratomi d7b7cbac1a Move to using a requirements.txt to install the python packages. (#21430)
Move to using a requirements.txt to install the python packages.

This makes it easy to keep the documentation and actual package
dependencies in sync.

Fixes #18453
8 years ago
John R Barker 5e28d3a15c network_cli shouldn't be specified anymore (#21458) 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
Tim Rupp 6fc989a902 Adds a factory function for getting REST api tools (#21423)
I plan on converting most all f5 modules to use the rest api, so
this is part of that conversion. it adds a factory method to get
the various rest management root apis provided in the f5 sdk
8 years ago
Matt Clay 9389fafae8 Enable MySQL tests on FreeBSD. 8 years ago
Peter Sprygada e1a2c6e1d3 roll up of fixes for eos modules (#21406)
* fixes issue with load_provider() not checking for an existing key
* adds updates to eos_config results key
* lots of minor syntax fixes in eos shared module
* adds eos_argument_spec to eos_eapi

fixes #21402
8 years ago
Pilou f2c22109fb Don't mix deprecations messages with warnings messages (#21337)
* Remove unused attribute '_passthrough'

* Don't mix deprecations with warnings

* Return values: add 'deprecations' key used internally

* 'deprecations' and 'warnings' return values: add tests
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
René Moser f2729f11c3 ios_config: fix "save" arg results in timeout (#21344)
* ios_config: fix "save" arg results in timeout

The command "copy running-config startup-config" prompts for a
destination filename, which was not handled.

~~~
testswitch#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
0 bytes copied in 0.679 secs (0 bytes/sec)

[15:16]
ios: write memory
~~~

* test_ios_config: adjust test_ios_config_save
8 years ago
Peter Sprygada 14b942f3fb updates eos modules to use socket (#21197)
* updates eos modules to use persistent connection socket
* removes split eos shared module and combines into one
* adds singular eos doc frag (eos_local to be removed after module updates)
* updates unit test cases
8 years ago
Ted Timmons 23886c5c0d add instructions for running pep8 locally (#21120) 8 years ago
Peter Sprygada 8adb108aa9 updates vyos modules to use socket connection (#21228)
* updates all vyos modules to use socket connection
* adds vyos local action handler
* adds exec_command() to vyos
* updates vyos_config local action
* update unit test cases
* add base class for testing vyos modules
8 years ago
Peter Sprygada 7f1c43e597 updates ios modules to support persistent socket (#21258)
* updates all ios modules to support persistent socket
* adds ios action plugin to connect to device
* adds exec_command() to ios shared module
* fixes ios_config and ios_template local action
* update all unit test cases
* adds base test module for ios module testing
8 years ago
Peter Sprygada 92aa92ebd2 updates netconf to use persistent socket (#21307) 8 years ago
Matt Martz 87aa59af79 Legacy pep8 updates for setup.py and tests 8 years ago
John R Barker 59306e2aef Add files via upload (#21062) 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 256a25bdcc Revert "Update galaxy and database unit tests." 8 years ago
Jordan Borean 5cabe420ea Added win_reg_stat module (#19145) 8 years ago
Matt Clay 2b9a0fb952 Update galaxy and database unit tests. (#21209)
* Update galaxy unit tests to work from tmp dir.
* Fix sorting of database tests.
8 years ago
Matt Clay 4189592701 Revert "Enable process isolation for unit tests."
This reverts commit 91526cd9f2.

Removing this feature primarily because it interferes with
collecting proper code coverage results. I may restore the
feature later if that can be resolved.
8 years ago
Jordan Borean 1c885cb848 Added fix for win_file with broken symlinks (#19146) 8 years ago
Matt Clay 91526cd9f2 Enable process isolation for unit tests. 8 years ago
Jordan Borean 1ce5fcf061 Added win_find module (#19144) 8 years ago
Matt Clay 57a5490c41 Fix test which fails on some python 2.6 installs. 8 years ago
s-hertel 65815c3875 Refactoring Galaxy unit tests for uniformity (#20828)
* Making tests more uniform

Removing unnecessary GalaxyCLI arguments/patching of the command line since parsing of the CLI args has been modified.

Run GalaxyCLI.parse() without saving the returned value to be uniform with the rest of the code.

Fix test_execute_remove to use the correct path

Use GalaxyCLI.run() instead of super(GalaxyCLI, gc).run() and GalaxyCLI.api = ansible.galaxy.api.GalaxyAPI(gc.galaxy).

* Refactor so one unit test checks one thing instead of multiple.

Improve readability by using a dict instead of lots of elifs

* Removing import used for debugging

* Fixing PEP 8 issues.

* Fix PEP 8 issues
8 years ago
Adrian Likins df3e4cd7f4 Don't check for var._obj in template._clean_data (#20868)
* Don't check for var._obj in template._clean_data

AnsibleUnsafe or other unsafe vars used to have a
'_obj' slot but no longer do. This was causing attribute
errors if a object was 'unsafe' but not a string.

Add tests for AnsibleUnsafe, lookups, and AnsibleContext
8 years ago
Adrian Likins e511326222 Fix 'yum skips updates' bug (#21113)
* Fix 'yum skips updates' bug

When the 'yum check-update' output is parsed, the regex used
to stitch wrapped lines together would fail on the first package.

It would fail because there is an empty line before the first
package, and this triggered the regex. To avoid a more complicated
regex, preprocess the check-update output to strip out any
empty lines.

The regex is also updated to include a group on the non whitespace
match to be used in the sub.

Add test cases based on info provided in the bug reports.

Fixes #20608
8 years ago
Matt Clay 1293ec85dd Convert unit test yield to pytest parametrize. 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
Marius Gedminas 2efb692cc4 known_hosts: support --diff (#20349)
* known_hosts: support --diff

* known_hosts: support --diff also without --check

* Add unit tests and fix incorrect diff in one corner case

Tests are good!

* Refactor for readability

* Python 3 compat

* More Python 3 compat

* Add an integration test for known_hosts

* Handle ssh-keygen -HF returning non-zero exit code

AFAICT this is a bug in ssh-keygen in some newer OpenSSH versions
(>= 6.4 probably; see commit dd9d5cc670):
when you invoke ssh-keygen with -H and -F <host> options, it always
returns exit code 1.  This is because in ssh-keygen.c there's a function
do_known_hosts() which calls

  exit (find_host && !ctx.found_key);

at the end, and find_host is 1 (because we passed -F on the command line),
but ctx.found_key is always 0.  Why is found_key always 0?  Because the
callback passed to hostkeys_foreach(), which is known_hosts_hash(),
never bothers to set found_key to 1.

* This test does not need root

* Avoid ssh-ed25519 keys in sample known_hosts file

Older versions of OpenSSH do not like them and ssh-keygen -HF
aborts with an error when it sees such keys:

  line 5 invalid key: example.net...
  /root/ansible_testing/known_hosts is not a valid known_hosts file.

* Fix Python 3 errors

Specifically, the default mode of tempfile.NamedTemporaryFile is 'w+b',
which means Python 3 wants us to write bytes objects to it -- but the
keys we have are all unicode strings.
8 years ago
Gaurav Rastogi 798972c72a Avi Networks Ansible modules. (#20415)
* Avi Networks Ansible modules.
Avi Version: 16.3.4

* Fixed Review comments
1. Changed description to be full sentences
2. Fixed Pep8 warnings.
3. Fixed comments and descriptions.

* 1. Fixed descriptions and messages as per review comments.
2. Added descriptions for the missing parameters.

* Fixed the shippable break due to the incorrect description format

* Removed the extra modules so that there is a single module for the first commit

* Updated license to BSD based on review comments

* updated comments based on review feedback

* Refactored code to handle POST and PUT scenarios where playbook does not need to check whether object is present.
Moved ansible helper utilities to module_utils as now roles can be patched with module_utils as well.

* fixed pep8 warnings
8 years ago
Matt Clay f16ee2841b Add retries to Shippable CI scripts. (#21108)
* Add retry.py for auto-retry in CI scripts.
* Add retries to other and units CI scripts.
8 years ago
Matt Clay 189fee4853 Fix vyos unit tests. 8 years ago
Ricardo Carrillo Cruz 0adca6b7d4 Set block indentation to 1 on iosxr templates (#21105)
Network devices in the lab have by default an indentation of 1 for
sub-sections, and so does the netcfg.NetworkConfig constructor
indent param.
This will fix reported issue 21055, and make the integration tests
to pass.

Fixes #21055
8 years ago
Adrian Likins 174961b945 Fix action test (#21102)
* update _parse_returned_data for no _ansible_parsed

_parse_returned_data no longer adds _ansible_parsed

* pep8 cleanups
8 years ago
Adrian Likins 7278308ca2 Redhat subscription (#20729)
* Make unused redhat_subscriptions do something

rhsm_baseurl/server_insecure were module params that were
never used previously. Hook them up for register options.

* pep8/style cleanups
* Set a module scope SUBMAN_CMD before we ref it as a global
* move ansible imports to top, remove '*' imports
* remove redhat_subscriptions from pep8 legacy
8 years ago
Nathaniel Case 530701b398 Vyos system module (#21060)
* vyos_system tests

* Merge vyos_system fixture with vyos_config fixture
8 years ago
Adrian Likins 5766689dd5 More unit tests for plugins/action/ (#20887) 8 years ago
Matt Martz 5942de603d Legacy pep8 clean fixes for contrib and hacking (#21081) 8 years ago
Brian Coca c86a17b7a0 refactoring async
- centralized skipping
- also fixed module name broken by previous refactor
- let action modules handle async processing
- moved async into base action class's module exec
- action plugins can now run final action as async
- actually skip copy if base skips
- fixed normal for new paths
- ensure internal stat is never async
- default poll to 10 as per docs
- added hint for callback fix on poll
- restructured late tmp, now a pipeline query
- moving action handler to connection as networking does
- fixed network assumption invocation is always passed
- centralized key cleanup, normalized internal var
- _supress_tmpdir_delete now in _ansible_xxx and gets removed from results
- delay internal key removal till after we use em
- nicer tmp removing, using existing methods
- moved cleanup tmp flag to mking tmp func
8 years ago
Matt Clay bce5fc7d96 Use us-east-2 for Windows CI on Shippable. 8 years ago
Ricardo Carrillo Cruz 375846d764 Refactor iosxr_facts to use network_cli plugin (#20857) 8 years ago
Loïc Blot b55d039f67 New modules: vmware_guest_facts & vmware_guest_snapshot (#20971)
* Move gather_facts action outside of vmware_guest module
* Move facts gathering method to vmware.py library
* vmware_guest use some vmware.py library methods
* vmware.py lib: fix some PEP 8 issues
* Move snapshot actions to vmware_guest_snapshot
* Move common snapshot facts to vmware.py library
8 years ago
John R Barker 25e144db4a Update legacy-files.txt 8 years ago
John R Barker 0ea3911d47 module_utils/vmware.py is now clean 8 years ago
Matt Clay 272ff10fa1 Fix @contextmanager leak on exception. (#21031)
* Fix @contextmanager leak on exception.
* Fix test leaks of global module args cache.
8 years ago
Matt Clay ccb1b742f5 Fix win_stat test for changes from PR #20876
The changes to win_file in that PR resulted in changes to file
sizes and file hashes expected by the win_stat tests.
8 years ago
Brian Coca a2c38c47aa added docs for vault and made trigger shorter: !vault (#20985)
* added docs for vault and made trigger shorter: !vault

* added single var valuting

* Update playbooks_vault.rst

Edit pass for spelling and grammar. Ship it!

* Update playbooks_vault.rst

Typo fixes.
8 years ago
Toshio Kuratomi d1a6b07fe1 Move ssh and local connection plugins from using raw select to selectors
At the moment, this change will use EPoll on Linux, KQueue on *BSDs,
etc, so it should alleviate problems with too many open file
descriptors.

* Bundle a copy of selectors2 so that we have the selectors API everywhere.
* Add licensing information to selectors2 file so it's clear what the
  licensing terms and conditions are.
* Exclude the bundled copy of selectors2 from our boilerplate code-smell test
* Rewrite ssh_run tests to attempt to work around problem with mocking
  select on shippable

Fixes #14143
8 years ago