Toshio Kuratomi
62979efa14
Finish up plugin porting to global display
...
Also remove display = display which does nothing
2015-11-11 10:44:23 -08:00
James Cammarata
86de1429e5
Cleaning up FIXMEs
2015-10-22 16:03:50 -04:00
Brian Coca
04aa7701d1
fix prompt, static methods don't get 'self'
...
fixes #12833
2015-10-21 12:06:29 -04:00
Toshio Kuratomi
f34b55ac2b
Add python3-compat boilerplate to all .py files in lib/ansible
2015-10-19 18:36:19 -07:00
Brian Coca
de3ca57a33
avoid relative shlex import
...
fixes #12777
2015-10-19 19:55:22 -04:00
Toshio Kuratomi
3da8bab3ff
Cleanup pyflakes warning (real error)
2015-10-19 11:29:51 -07:00
Toshio Kuratomi
b67e51ea06
Information on when to use to_str() and what a native string is
2015-10-19 09:28:43 -07:00
Brian Coca
71ffb86c30
don't let cowsay issues stop execution
...
fixes #12773
2015-10-16 15:20:59 -04:00
Toshio Kuratomi
baa309309d
Bundle a new version of python-six for compatibility along with some code to make it easy for distributions to override the bunndled copy if they have a new enough version.
2015-10-16 08:21:28 -07:00
James Cammarata
dce58a78c9
Make random cowsay truly random
...
Also adds a cowsay whitelist config option, because there are some
truly NSFW stencils that come with cowsay by default.
2015-10-15 10:52:53 -04:00
Marius Gedminas
ab569cea22
Move to_str alias into ansible.utils.unicode
...
@abadger suggested on IRC that it's useful enough to go into
ansible.utils.unicode.
2015-10-15 10:27:38 +03:00
Toshio Kuratomi
b441bcb678
Fix display when run through a testing framework that overrides stderr/stdout
2015-10-12 10:06:13 -07:00
Toshio Kuratomi
d1b98ec776
Correct typo
2015-10-08 08:44:25 -07:00
Toshio Kuratomi
2f5e817007
Do not mix byte str with unicode type
2015-10-08 08:31:12 -07:00
Toshio Kuratomi
01ba2e94c0
Wait until later to convert to byte strings for output
...
Also some pre-emptive python3 compat and a code simplification
2015-10-08 08:22:17 -07:00
Brian Coca
4463ced8ba
simpler safe output
2015-10-08 10:15:48 -04:00
Brian Coca
d8769c93c7
updated ec2 region description to add missing other env var
2015-10-07 16:41:58 -04:00
Brian Coca
c77733e64e
added docs for commonly used region parameter in some ec2 modules
2015-10-07 15:52:06 -04:00
Brian Coca
f73329401b
galaxy updates
...
better error reporting on fetching errors
use scm if it exists over src
unified functions in requirements
simplified logic
added verbose to tests
cleanup code refs, unused options and dead code
moved get_opt to base class
fixes #11920
fixes #12612
fixes #10454
2015-10-05 11:43:08 -04:00
James Cammarata
aa3687d736
Fix syntax error for octal in encrypt methods
2015-10-02 02:27:57 -04:00
James Cammarata
8ef78b1cf8
Fixing accelerated connection plugin
2015-10-02 00:50:02 -04:00
soarpenguin
1ea66e234f
fix logic judgment error.
2015-09-26 15:15:53 +08:00
soarpenguin
2caa52a981
fix no self pointer out of class.
2015-09-26 14:09:56 +08:00
Marius Gedminas
5d29a2eabd
Python 3: shlex.split() wants unicode
...
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.
2015-09-24 12:36:05 +03:00
James Cammarata
cc6627cdd6
Remove custom json encoder cleaner and strip proxy var stuff out before encoding
...
Fixes #12349
2015-09-17 16:04:47 -04:00
James Cammarata
5db9e38377
Merge pull request #12345 from mgedmin/py3k
...
Python 3: two more instances of 'basestring'
2015-09-16 16:49:46 -04:00
Andriy Yurchuk
af213241ab
Fix typo
2015-09-14 21:11:40 +02:00
Marius Gedminas
9877a5c415
Python 3: two more instances of 'basestring'
...
Fixes two failing tests on Python 3.4.
2015-09-14 08:27:39 +03:00
James Cammarata
30399edada
Use UnsafeProxy for lookup results too
...
Also fixes a couple of bugs that popped up when using the proxy class
2015-09-08 12:19:39 -04:00
James Cammarata
ff9f5d7dc8
Starting to add additional unit tests for VariableManager
...
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.
2015-09-04 16:41:38 -04:00
Toshio Kuratomi
aeff960d02
Cleanup combine_vars
...
* Dedupe combine_vars() code (removed from VariableManager)
* Fix merge_hash algorithm to preserve the type
* unittest combine_vars and merge_hash
2015-09-01 11:23:12 -07:00
Marius Gedminas
54dbfba8f8
Make combine_vars() compatible with Python 3
...
Fixes
TypeError: unsupported operand type(s) for +: 'dict_items' and 'dict_items'
on Python 3.
2015-09-01 09:39:59 +03:00
James Cammarata
2043fcd5db
Merge pull request #12083 from resmo/for-ansible
...
cloudstack: implement general api_region support, update docs
2015-08-28 13:14:50 -04:00
James Cammarata
5a5b9f211b
Validate variable names when loading 'vars:' blocks
...
TODO: add this to VariableManager to validate vars loaded from files too
Fixes #12022
2015-08-28 11:36:31 -04:00
Marius Gedminas
eb99aa8c68
Fix to_bytes(None) on Python 3
...
You cannot call bytes(obj) to get a simple representation of obj on
Python 3! E.g. bytes(42) returns a byte string with 42 NUL characters
instead of b'42'.
2015-08-27 22:15:56 +03:00
Marius Gedminas
da1e611b26
Support print as a function
...
I neglected the __future__ import because
print(one_thing)
works the same way even when print is a statement.
2015-08-27 22:15:56 +03:00
Marius Gedminas
0c6ce31f76
Use 'except ... as' syntax
...
This syntax works on Python 2.6 through 3.x. lib/ansible/module_utils
(and lib/ansible/modules) need to support Python 2.4, so I didn't touch
those.
2015-08-27 22:15:04 +03:00
Brian Coca
2ac931d6c9
ported module_docs to use display
2015-08-27 14:57:50 -04:00
Rene Moser
3db4039ad1
cloudstack: implement general api_region support, update docs
2015-08-25 13:54:21 +02:00
James Cammarata
c7dde72aa0
Default listify to converting bare variables again
...
Since we explicitly set convert_bare=False in the template lookup
code, but still want individual looks that call listify directly to
convert bare variables if needed.
2015-08-12 10:49:46 -04:00
Brian Coca
6e825e8c22
fixed listify for lookups, made sure convert_bare is only on with_
2015-08-11 16:42:09 -04:00
Brian Coca
5f0359c119
keep banners at 79
2015-08-06 17:37:05 -04:00
Brian Coca
25e67bb716
text wrap now adapts to terminal
2015-08-06 17:37:05 -04:00
James Cammarata
d44daf53cc
Allow wrapped text in deprecated messages
2015-08-06 17:21:02 -04:00
James Cammarata
5266679964
Use templar all the way down
...
Fixes bugs related to creating Templar() objects on the fly, where
the shared loader objects (serialized to TaskExecutor) aren't used
so information loaded into plugin loaders after forking is lost.
Fixes #11815
2015-08-04 12:25:53 -04:00
James Cammarata
2673eb0afb
Add option to fail on undefined variables to listify
...
And use it in the call to get the loop items for a task.
2015-08-03 12:04:31 -04:00
Brian Coca
164092a835
optimized module docs
2015-07-27 20:52:53 -04:00
Brian Coca
0b6fadaad7
started implementing diff
...
diff now works with template
also fixed check mode for template and copy
2015-07-26 12:22:22 -04:00
Brian Coca
b19eb0f4dc
minor improvements to display
2015-07-25 09:15:33 -04:00
Toshio Kuratomi
36382face9
Add a warning about mode being octal
2015-07-24 14:52:21 -07:00