Commit graph

133 commits

Author SHA1 Message Date
James Cammarata
48d62fd934 Cleaning up VariableManager tests (v2) 2015-05-14 20:10:31 -05:00
James Cammarata
a0509cda1e Fix test_role unit tests to use unique role names to avoid role caching errors 2015-05-14 14:31:11 -05:00
James Cammarata
1ca8cb8553 Fixing up v2 unit tests 2015-05-12 12:24:57 -05:00
Toshio Kuratomi
f9f8af06fc Change asserts to assertIsInstance for better error messages 2015-05-08 13:49:10 -07:00
Matt Martz
a0fc8bb0bd Testing additions and fixes
* Fix import pathing for units.mock
* Add some additional requirements
* Use compileall to test compatiblity with different python versions
2015-05-08 13:40:02 -05:00
James Cammarata
ce3ef7f4c1 Making the switch to v2 2015-05-03 21:47:26 -05:00
Jesse Rusak
652cd6cd5e Fix --force-handlers, and allow it in plays and ansible.cfg
The --force-handlers command line argument was not correctly running
handlers on hosts which had tasks that later failed. This corrects that,
and also allows you to specify force_handlers in ansible.cfg or in a
play.
2015-04-10 19:38:59 -04:00
James Laska
60acdee0dc Enable assert_raises_regexp on py26 2015-03-13 08:21:14 -04:00
Toshio Kuratomi
f05cda6ffc Comma is also dependent on position within the hash 2015-03-12 13:20:51 -07:00
Brian Coca
74bf59082d fixed and reintroduced syncronize test, fakerunner object needed become_method to be it's default 'sudo' 2015-03-12 14:48:06 -04:00
Toshio Kuratomi
644e50fe34 Hash randomization makes one of the heuristic_log_sanitize checks not work.
Nothing we can do, when it sanitizes ssh_urls it's simply overzealous.
2015-03-12 11:39:47 -07:00
Brian Coca
587ab17f10 fixes password error detection for ssh connection plugin
removes sycnronize test that does not work with current sudo setup
Fixes #10434
2015-03-11 16:11:27 -04:00
Brian Coca
5f6db0e164 preliminary privlege escalation unification + pbrun
- become constants inherit existing sudo/su ones
- become command line options, marked sudo/su as deprecated and moved sudo/su passwords to runas group
- changed method signatures as privlege escalation is collapsed to become
- added tests for su and become, diabled su for lack of support in local.py
- updated playbook,play and task objects to become
- added become to runner
- added whoami test for become/sudo/su
- added home override dir for plugins
- removed useless method from ask pass
- forced become pass to always be string also uses to_bytes
- fixed fakerunner for tests
- corrected reference in synchronize action plugin
- added pfexec (needs testing)
- removed unused sudo/su in runner init
- removed deprecated info
- updated pe tests to allow to run under sudo and not need root
- normalized become options into a funciton to avoid duplication and inconsistencies
- pushed suppored list to connection classs property
- updated all connection plugins to latest 'become' pe

- includes fixes from feedback (including typos)
- added draft docs
- stub of become_exe, leaving for future v2 fixes
2015-03-10 18:42:36 -04:00
Toshio Kuratomi
ffb281d96c Merge pull request #9600 from msabramo/make_AnsibleError_a_plain_ol_exception
Make AnsibleError a plain ol' exception
2015-03-03 09:56:09 -08:00
Alejandro Guirao
b8cf131375 Bug fix: Search only for files as candidates 2015-02-26 19:13:07 +01:00
Brian Coca
8872bba21f rearranged math filters 2015-02-18 20:03:05 -05:00
Brian Coca
2642738646 changed jsonify test to ignore whitespace 2015-02-18 12:09:22 -05:00
Brian Coca
bc5d0a8cd4 fixed jsonify test 2015-02-17 08:58:52 -05:00
Brian Coca
5f2d5abeea ensure proper strings/unicodestrings for passwords
updated to correct to_bytes function
removed old to_bytes/to_unicode and repointed clients to new location
fixed unicode test
2015-02-12 17:44:08 -05:00
Toshio Kuratomi
4902c06304 Obfuscate passwords in more places where it is displayed 2015-02-09 10:13:13 -08:00
Marc Abramowitz
372a29744b Make AnsibleError a plain ol' exception
Python's Exception constructor already takes a `message` as a parameter,
which you can then get at by doing str(e) (e.message was deprecated).

The reason I bothered to make this change was because I was debugging
with pdb and I noticed that AnsibleErrors don't give useful information
in pdb (probably because they don't have a __repr__ method that prints
the `msg` attribute).

    (Pdb) c
    > /Users/marca/dev/git-repos/ansible/lib/ansible/runner/__init__.py(599)_executor()
    -> msg = str(ae)
    (Pdb) ae
    AnsibleError()
2015-01-29 10:36:06 -08:00
Björn Andersson
65e4f2b2bc Add filter to turn a string into a UUID
This filter was made because I needed to create idempotent UUIDs when
installing the agent for Go (http://go.cd), which uses UUIds to
distinguish the agents from each other.

It uses a newly created Ansible namespace to distinguish UUIDs created
by Ansible from any other source. The new namespace is a random one
created by uuidgen on OSX.
2015-01-21 08:07:17 +08:00
Michael DeHaan
d4da58e102 Merge pull request #9720 from vlajos/typofixes-vlajos-20141204
typofixes - https://github.com/vlajos/misspell_fixer
2014-12-08 14:00:52 -08:00
Veres Lajos
bf5d8ee678 typofixes - https://github.com/vlajos/misspell_fixer 2014-12-04 22:23:35 +00:00
Brian Coca
97408fe5b2 Revert "Make listify respect the global setting for undefined variables."
This 'mostly' reverts commit 2769098fe7.

Conflicts:
	lib/ansible/utils/__init__.py
	test/units/TestUtils.py
2014-12-04 09:14:53 -05:00
Brian Coca
7d2937b1cc minor fixes to template function
- make sure it calls itself correctly, now passes same params as it recieves
- vars is reserved, changed for templatevars to avoid confustion
- forcing mustaches again since the removal broke 'listification' as per #9622
- fixes incorrectly successful tests using undefined var, now it is defined
- now returns empty list if items is None to avoid errors
2014-11-25 12:59:13 -05:00
Toshio Kuratomi
d36c38c35e Exception message changes 2014-11-25 02:36:38 -08:00
Toshio Kuratomi
067112b5ee Code for modules to perform more robust quoting of database identifiers 2014-11-24 20:55:44 -08:00
Toshio Kuratomi
4ae2d58d72 Fix detection of fips mode in test_do_encrypt_md5 2014-11-17 13:33:30 -08:00
James Cammarata
9a0f8f0158 Split out various vars-related things to avoid merging too early
Fixes #9498
2014-11-17 15:31:55 -06:00
Toshio Kuratomi
d14dcdc222 Docker test does not require the mock module 2014-11-14 08:59:36 -08:00
Toshio Kuratomi
b95475c1f9 Unittest the get_split_image_tag function in the docker module 2014-11-14 08:48:21 -08:00
Toshio Kuratomi
6030be3835 Add unittest for discrete functions in the apt module 2014-11-14 07:55:10 -08:00
Toshio Kuratomi
44eb19d553 Make VaultEditor Tests compatible with FIPS mode
Migrate one test to vault-1.1.  Skip the two other vault 1.0 tests if
running on a FIPS enabled system
2014-11-12 12:05:25 -08:00
Toshio Kuratomi
e05b22e0d1 Skip some md5 related unit tests when running in fips mode 2014-11-12 11:47:11 -08:00
Toshio Kuratomi
f1267c0b05 Move from md5 to sha1 to work on fips-140 enabled systems 2014-11-06 21:28:04 -08:00
Toshio Kuratomi
48a308a87c Allow both old-style and new-style role dependencies to be valid.
Fixes #9173
2014-10-09 02:48:47 -04:00
Rob Howard
2769098fe7 Make listify respect the global setting for undefined variables.
(Fixes #9008.)

With credit to jimi-c for the initial pass in this commit:
b18bd6b98e
2014-10-08 13:47:11 +11:00
Michael DeHaan
4cb7f654b6 Add stub tests for module args parsing. 2014-10-07 17:00:01 -04:00
Michael DeHaan
6db1b4dfd2 WIP on refactoring changes 2014-10-03 15:25:21 -04:00
Toshio Kuratomi
e6fcd90342 Merge pull request #9224 from drawks/iss9223
Resolve #9223 Fix test for python 2.6
2014-10-01 11:54:44 -04:00
Toshio Kuratomi
e00d657362 Make unittest compatible with python <= 2.6 2014-10-01 11:50:45 -04:00
Dave Rawks
5f54b57b6d Corrected indentation 2014-09-30 13:37:47 -07:00
Toshio Kuratomi
0af750e3e5 Merge pull request #9182 from bbasleeper/feature_sudo_exe_from_inventory
Add a new inventory parameter (ansible_sudo_exe) to specify sudo command...
2014-09-30 14:55:46 -04:00
Dave Rawks
c070ab69f7 Resolve #9223 Fix test for python 2.6
* trivial test refactor to allow for python 2.6 compat
2014-09-30 11:24:47 -07:00
Bruno BAILLUET
a25da4af05 Add a new inventory parameter (ansible_sudo_exe) to specify sudo command path. 2014-09-27 17:39:49 +02:00
Michael DeHaan
f35ed8a6c0 Update module test code to avoid pycs (that are not used) 2014-09-26 10:57:12 -04:00
Michael DeHaan
d6e6d2a6ca Remove regex related to baby-JSON parsing only. 2014-09-11 13:30:10 -04:00
Michael DeHaan
26cdddaebf Tracebacks are now catchable with ignore_errors and have streamlined output. Also removes 'baby-JSON' for bash modules. 2014-09-11 12:27:21 -04:00
James Cammarata
317ab06bc6 Fixing multiline parsing to preserve newlines
Fixes #8813
2014-09-10 15:14:46 -05:00