Commit Graph

108 Commits (5a1e35224b82e8f0776dfea3d34bcb005195bbdb)

Author SHA1 Message Date
Matt Clay 5b79ed77e7 Use to_bytes on filenames in filesystem calls. 2016-03-04 09:08:41 -08:00
Brian Coca e762095497 better task parsing errors
fixes #14790
2016-03-03 19:51:15 -05:00
Brian Coca cc3cb0f65e fix issues with older yaml lib versions
also added missing json import and removed unused ones
2016-03-03 18:13:36 -05:00
Brian Coca ea5e089056 restore initial json parsing attempt to loader
fixes issues with extra vars json strings not being parsed correctly by the yaml parser
2016-03-03 13:26:50 -05:00
Toshio Kuratomi 4657be4eab Transform pathnames to bytes before passing on to os.path functions 2016-03-03 09:03:28 -08:00
James Cammarata 7c049c3200 Fixing up jsonify and adding unit tests 2016-02-29 14:51:23 -05:00
Toshio Kuratomi 1f2595306a normalize path components to unicode before combining or operating on them
Note that this will break if we deal with non-utf8 paths.  Fixing this
way because converting everythig to byte strings instead is a very
invasive task so it should be done as a specific feature to provide
support for non-utf8 paths at some point in the future (if needed).
2016-02-26 10:29:37 -08:00
Toshio Kuratomi ef8bec18bf Use a unicode format string so that we don't convert to byte strings
Fixes #14349
2016-02-26 10:29:37 -08:00
Matt Martz 38b663471d Merge pull request #14311 from sivel/unsafe-yaml-constructor
Add new 'unsafe' YAML constructor
2016-02-23 11:29:53 -06:00
Brian Coca 0f73fb0d6f better error messages when failing to decrypt 2016-02-18 08:57:28 -08:00
Jonathan Davila b220051c14 Added more info to the no action detected error
Error fix
2016-02-08 16:51:10 -05:00
Matt Martz 8bc2d3be9c Add new 'unsafe' YAML constructor 2016-02-04 10:08:42 -06:00
Brian Coca db375c22af load now does not modify the incomming data
also removed json loader as yaml loader can do both
2016-01-28 19:43:17 -05:00
Brian Coca c063803a91 raise AnsibleError as an 'expected' exception
fixes #14065
2016-01-25 22:20:55 -05:00
Brian Coca f26adcc7da avoid shredding empty files, also x/0
also cleaned up unused import and exception var
2016-01-21 10:54:56 -05:00
James Cammarata 46e515131e Allow module args as k=v pairs when using the module: option with local_action
This task format is valid in 1.x, but was broken in 2.x:
  - local_action:
     module: shell echo "hello world"
2016-01-18 14:32:44 -05:00
Toshio Kuratomi 4958180333 use integer division instead of floating point division.
Fixes #13855
2016-01-13 12:35:28 -08:00
Eric Feliksik 11ce08b9dd cleaner implementation and random chunk length. 2016-01-05 18:04:38 +01:00
Eric Feliksik 151e09d129 use unix shred if possible, otherwise fast custom impl; do not shred encrypted file 2016-01-05 01:43:42 +01:00
Eric Feliksik 1e911375e8 add docs, remove unnecessary int() cast 2016-01-04 18:13:59 +01:00
Eric Feliksik 7193d27acc add os.fsync() so that the shredding data (hopefully) hits the drive 2016-01-04 17:22:18 +01:00
Eric Feliksik 946b82bef7 shred ansible-vault tmp_file. Also when editor is interruped. 2015-12-30 18:21:34 +01:00
Brian Coca 75e94e0cba allow for non standard hostnames
* Changed parse_addresses to throw exceptions instead of passing None
* Switched callers to trap and pass through the original values.
* Added very verbose notice
* Look at deprecating this and possibly validate at plugin instead
fixes #13608
2015-12-21 13:42:34 -05:00
James Cammarata 8716bf8021 All variables in complex args again
Also updates the CHANGELOG to note the slight change, where bare variables
in args are no longer allowed to be bare variables

Fixes #13518
2015-12-16 16:39:08 -05:00
James Cammarata 2b36343451 Missed one place we were appending the incorrectly escaped item to raw params 2015-12-09 17:58:44 -05:00
James Cammarata 1799de8528 Preserve original token when appending to _raw_params in parse_kv
Fixes #13311
2015-12-08 15:06:36 -05:00
Toshio Kuratomi a8e015cc22 Add representers so we can output yaml for all the types we read in from yaml 2015-12-06 22:17:47 -08:00
Monty Taylor d20e67d708 Put in trap for args being None
_normalize_old_style_args can return None. If it does, the loop
"for args in args" blows up.
2015-11-28 13:38:11 -05:00
Yannig Perré 2fc7c8b460 More restrictive test against variable name to allow setting variable starting with _. 2015-11-28 10:35:06 +01:00
Yannig Perré 2c54fb1339 Switch parameters validation after parsing in order to be more consistent between old and new style. 2015-11-26 13:33:58 +01:00
Matteo Acerbi 0127d32652 Fix DataLoader's docstring
DataLoader.__init__ doesn't take an argument named vault_password
2015-11-18 11:20:34 +01:00
Abhijit Menon-Sen 7caefa5cd9 Fix typo 2015-11-03 10:57:48 +05:30
Brian Coca 00bc74404a vault noe preserves permissions on edit and rekey and sets a restricitve default umask for all other cases 2015-10-31 14:13:03 -04:00
Toshio Kuratomi e3e2db1119 Improve the warning message about duplicate yaml dict keys 2015-10-27 14:20:36 -07:00
Toshio Kuratomi 4203850d1a Break apart a looped dependency to show a warning when parsing playbooks
Display a warning when a dict key is overwritten by pyyaml
Fixes #12888
2015-10-27 12:39:42 -07:00
James Cammarata 86de1429e5 Cleaning up FIXMEs 2015-10-22 16:03:50 -04:00
James Cammarata 0bbe9d5bd0 Make hostvars json/yaml serializable in filters
Fixes #12615
2015-10-18 10:09:05 -04:00
Toshio Kuratomi b23a083776 Make vault use a mapping of cipher name to classes instead of formatting the name for safety. 2015-10-16 10:05:27 -07: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
Marius Gedminas 98958ec990 Simplify join expression 2015-10-16 17:39:27 +03:00
Marius Gedminas 56184a3d8c Python 3: avoid %-formatting of byte strings
This is needed for Python 3.4 compatibility; Python 3.5 can use
`b'%s\n' bytestring` again.
2015-10-16 17:18:35 +03:00
Toshio Kuratomi 85abd61001 Add some more info to docstring 2015-10-14 18:57:10 -07:00
Brian Coca abf2e13955 Revert "Track local_action internally to prevent it from being overridden"
This reverts commit 49ca0eb797.
2015-10-09 13:01:32 -04:00
Brian Coca 101c8785ec removed changes to make local action equate connection=local and brought it back to equate delegate_to=localhost 2015-10-09 13:01:32 -04:00
Brian Coca 3705d54485 fixed error reporting on splitter 2015-10-01 19:03:04 -04:00
Brian Coca a680ef66dd fixed vault password file script execution 2015-10-01 18:49:51 -04:00
Abhijit Menon-Sen 0bb34fd076 Make «ansible-vault view» not write plaintext to a tempfile
CLI already provides a pager() method that feeds $PAGER on stdin, so we
just feed that the plaintext from the vault file. We can also eliminate
the redundant and now-unused shell_pager_command method in VaultEditor.
2015-09-30 22:13:36 +05:30
Toshio Kuratomi dcdcd9e9c5 Move is_executable to the toplevel of basic.py so we can utilize it from other code 2015-09-25 07:48:57 -07:00
James Cammarata 95b371dd60 Use AnsibleFileNotFound instead of AnsibleParsingError when YAML files are not found
And update portions of code to expect the proper error.

Fixes #12512
2015-09-24 16:27:25 -04:00
Marius Gedminas fc0dcc3947 Python 3: there's no basestring
Fixes one failing test.

Now technically a filename can be a bytestring, even on Python 3.  I
hope this is unlikely for Ansible.
2015-09-22 08:42:33 +03:00