- 30 Sep, 2015 6 commits
-
-
(I don't have a system with selinux to test if the module still wants byte strings even on Python 3.)
Marius Gedminas committed -
Marius Gedminas committed
-
This caused an ImportError in a test module and showed up as one test failure. Now the test module can get imported and many more tests fail (on Python 3). Such is life. ;-)
Marius Gedminas committed -
James Cammarata committed
-
Abhijit Menon-Sen committed
-
Abhijit Menon-Sen committed
-
- 26 Sep, 2015 1 commit
-
-
* allow global no_log setting, no need to set at play or task level, but can be overriden by them * allow turning off syslog only on task execution from target host (manage_syslog), overlaps with no_log functionality * created log function for task modules to use, now we can remove all syslog references, will use systemd journal if present * added debug flag to modules, so they can make it call new log function conditionally * added debug logging in module's run_command
Brian Coca committed
-
- 25 Sep, 2015 1 commit
-
-
Due to the way we're now calculating delegate_to, if that value is based on a loop variable ('item') we need to calculate all of the possible delegated_to variables for that loop. Fixes #12499
James Cammarata committed
-
- 24 Sep, 2015 5 commits
-
-
There doesn't appear to be anything that actually uses tmp_path in the connection plugins so we don't need to pass that in to exec_command. That change also means that we don't need to pass tmp_path around in many places in the action plugins any more. there may be more cleanup that can be done there as well (the action plugin's public run() method takes tmp as a keyword arg but that may not be necessary). As a sideeffect of this patch, some potential problems with chmod and the patch, assemble, copy, and template modules has been fixed (those modules called _remote_chmod() with the wrong order for their parameters. Removing the tmp parameter fixed them.)
Toshio Kuratomi committed -
The value was useless -- unused by the callers and always hardcoded to the empty string.
Toshio Kuratomi committed -
Also, on Python 3 the stock object.__hash__ raises an error ("unhashable type"), and we have code that uses Host instances as dict keys.
Marius Gedminas committed -
Marius Gedminas committed
-
On Python 2, shlex.split() raises if you pass it a unicode object with non-ASCII characters in it. The Ansible codebase copes by explicitly converting the string using to_bytes() before passing it to shlex.split(). On Python 3, shlex.split() raises ('bytes' object has no attribute 'read') if you pass a bytes object. Oops. This commit introduces a new wrapper function, shlex_split, that transparently performs the to_bytes/to_unicode conversions only on Python 2. Currently I've only converted one call site (the one that was causing a unit test to fail on Python 3). If this approach is deemed suitable, I'll convert them all.
Marius Gedminas committed
-
- 18 Sep, 2015 2 commits
-
-
Abhijit Menon-Sen committed
-
Abhijit Menon-Sen committed
-
- 17 Sep, 2015 5 commits
-
-
Abhijit Menon-Sen committed
-
Victor Salgado committed
-
There were no inventory-specific unit tests earlier, so we add a new directory for them with some initial low-level tests of _split_pattern with various valid and deprecated pattern strings.
Abhijit Menon-Sen committed -
Florian Apolloner committed
-
Florian Apolloner committed
-
- 15 Sep, 2015 1 commit
-
-
Brian Coca committed
-
- 14 Sep, 2015 2 commits
-
-
James Cammarata committed
-
Fixes #12053
James Cammarata committed
-
- 11 Sep, 2015 3 commits
-
-
Labels must start with an alphanumeric character, may contain alphanumeric characters or hyphens, but must not end with a hyphen. We enforce those rules, but allow underscores wherever hyphens are accepted, and allow alphanumeric ranges anywhere. We relax the definition of "alphanumeric" to include Unicode characters even though such inventory hostnames cannot be used in practice unless an ansible_ssh_host is set for each of them. We still don't enforce length restrictions—the fact that we have to accept ranges makes it more complex, and it doesn't seem especially worthwhile.
Abhijit Menon-Sen committed -
This adds a parse_address(pattern) utility function that returns (host,port), and uses it wherever where we accept IPv4 and IPv6 addresses and hostnames (or host patterns): the inventory parser the the add_host action plugin. It also introduces a more extensive set of unit tests that supersedes the old add_host unit tests (which didn't actually test add_host, but only the parsing function).
Abhijit Menon-Sen committed -
There was code to support set literals (on Python 2.7 and newer), but it was buggy: SAFE_NODES.union() doesn't modify SAFE_NODES in place, instead it returns a new set object that is then silently discarded. I added a unit test and fixed the code. I also changed the version check to use sys.version_tuple instead of a string comparison, for consistency with the subsequent Python 3.4 version check that I added in the previous commit.
Marius Gedminas committed
-
- 10 Sep, 2015 1 commit
-
-
James Cammarata committed
-
- 09 Sep, 2015 1 commit
-
-
Toshio Kuratomi committed
-
- 08 Sep, 2015 2 commits
-
-
Toshio Kuratomi committed
-
Fixes #12245
James Cammarata committed
-
- 07 Sep, 2015 2 commits
-
-
Marius Gedminas committed
-
The full error was ====================================================================== ERROR: test_task_executor_execute (units.executor.test_task_executor.TestTaskExecutor) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/mg/src/ansible/test/units/executor/test_task_executor.py", line 252, in test_task_executor_execute mock_action.run.return_value = dict(ansible_facts=dict()) File "/home/mg/src/ansible/lib/ansible/executor/task_executor.py", line 317, in _execute if self._task.async > 0: TypeError: unorderable types: MagicMock() > int() ---------------------------------------------------------------------- Experiments show that Python 2 MagicMock() > 0 is true, so I'm setting the async property on mock_task to 1. (If I set it to 0, the test fails anyway.)
Marius Gedminas committed
-
- 04 Sep, 2015 3 commits
-
-
Required some rewiring in inventory code to make sure we're using the DataLoader class for some data file operations, which makes mocking them much easier. Also identified two corner cases not currently handled by the code, related to inventory variable sources and which one "wins". Also noticed we weren't properly merging variables from multiple group/host_var file locations (inventory directory vs. playbook directory locations) so fixed as well.
James Cammarata committed -
simplify become testing and handling, we had drifted and were doulbe checking prompt, become and become_pass fixed tests to conform to new signature and now tests both with and w/o password now we are more explicit about self.prompt
Brian Coca committed -
Fixes #12198 Fixes #12241
Toshio Kuratomi committed
-
- 03 Sep, 2015 3 commits
-
-
James Cammarata committed
-
Also fix the bug (missing from six import iteritems) I introduced in 823677b4.
Marius Gedminas committed -
Replace .iteritems() with six.iteritems() everywhere except in module_utils (because there's no 'six' on the remote host). And except in lib/ansible/galaxy/data/metadata_template.j2, because I'm not sure six is available there.
Marius Gedminas committed
-
- 02 Sep, 2015 2 commits
-
-
Toshio Kuratomi committed
-
James Cammarata committed
-