1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
Commit graph

30 commits

Author SHA1 Message Date
Rory Finnegan
3e25f633fe Applied some stashed fixes.
* Fixed file.close() typo in test_vault_editor
 * Updated unicode.py to redefine basestring properly in python3 and fixed a couple missed py27 specific code.
 * Realized the patch in test_data_loader was still failing cause we are passing the string 'builtins.open' and not actually using it in that file and soe instead of failing in py34 it would fail in py27.
2015-04-16 17:20:46 -04:00
Rory Finnegan
f3fed01a7e Attempted to updated the vault editor to support 2/3 compatibility.
Unfortunately, I wasn't able to fix a bug in the VaultAES in which during
the test_decrypt_1_0 and test_rekey_migration in which VaultAES wasn't successfully
writing the writing the encrypted key to out_file (BytesIO).

Added skipping vault_editor tests test_decrypt_1_0 and test_rekey_migration in python3
since I wasn't able to successfully backport VaultAES without weird bugs.
2015-04-16 16:01:21 -04:00
Rory Finnegan
176ae06cbd Updated the vault/__init__.py and test_vault.py files to support 2/3.
Existing tests pass under both versions, but there could still be some issues
since, it involves a lot of 2/3 bytes-unicode conversions.
2015-04-16 16:01:21 -04:00
Rory Finnegan
28443cf0a9 Updated parsing/vault/test_vault.py to use the fake byte literals in six when using hexlify.
This was to fix the `TypeError: 'str' does not support the buffer interface` errors.
2015-04-16 16:01:21 -04:00
Rory Finnegan
1e139fe08f Updated the test_data_loader to use six.builtins vs __builtins__ 2015-04-16 16:01:21 -04:00
Rory Finnegan
77cd7a6e89 Fixed 2/3 compatibility issues in parsing/yaml/test_loader with six. 2015-04-16 16:01:20 -04:00
ian
3bb7b0eef3 Import StringIO from six in a couple more places. 2015-04-13 16:03:02 -04:00
Toshio Kuratomi
349ecf6efe Add a vault test to data_loader test and some additional yaml tests to parsing/yaml/test_loader 2015-04-03 11:39:56 -07:00
Toshio Kuratomi
2cddb093f5 Add AnsibleList for keeping track of line numbers in lists parsed from yaml 2015-04-02 12:37:02 -07:00
Toshio Kuratomi
69cf95bd0e Add __init__ to the yaml test dir 2015-04-01 15:00:50 -07:00
Toshio Kuratomi
e697de6076 Move AnsibleBaseBaseYAMLObject's position_info into a property 2015-04-01 14:54:22 -07:00
Toshio Kuratomi
05f1bed12b Use the node's start_mark to determine line and column.
* Elminates a lot of logic in the AnsibleComposer class.
* Update tests with new column offsets.  The rule should now be
  consistently: Column is the start of the entry's value (so for
  strings, the first non-space after the entry beginning, for dicts, the
  first character of the first key)
2015-04-01 13:51:01 -07:00
Toshio Kuratomi
b152275a36 Test line numbers and "fix" a bug in the scalar line counting 2015-04-01 12:18:53 -07:00
Toshio Kuratomi
c41b917162 Add a yaml constructor for unicode strings:
* Changes AnsibleConstructor so that only unicode strings are returned
  (no str type)
* Tracks line, column numbers for strings
* Adds unittests for AnsibleLoader (generic for all the yaml parsing)
2015-04-01 09:37:54 -07:00
Toshio Kuratomi
43c1a97447 Various unicode and backslash escape cleanups
* Do backslash escape parsing in parse_kv() [was being done in the copy
  module purely for newlines in the copy module's content param before]
* Make parse_kv always return unicode
* Add bandaid to transform args to unicode until we can fix things
  calling parse_kv to always send it unicode.
* Make split_args deal with unicode internally.  Warning, no bandaid for
  things calling split_args without giving it unicode (shouldn't matter
  as dealt with str internally before)
* Fix copy and unarchive action plugins to not use setdefaultencoding
* Remove escaping from copy (it was broken and made content into latin-1
  sometimes). escaping is now in parse_kv.
* Expect that content is now a unicode string so transform to bytes just
  before writing to the file.
* Add initial unittests for split_args and parse_kv.  4 failing
  tests.because split_args is injecting extra newlines.
2015-03-30 19:19:34 -07:00
James Cammarata
62d79568be Creating playbook executor and dependent classes 2014-12-29 10:46:47 -06:00
James Cammarata
229d49fe36 Adding new playbook objects for v2
* Playbook
* TaskInclude
2014-11-05 21:13:47 -06:00
Toshio Kuratomi
e99dc5a57c Add copyright and py3 compat header 2014-10-28 20:40:39 -04:00
Toshio Kuratomi
67ff4428d5 Fix up all python3 issues that do not have to do with text/bytes 2014-10-28 20:27:14 -04:00
James Cammarata
7cb489eca3 Adding a data parsing class for v2 2014-10-24 14:06:43 -05:00
James Cammarata
2ff17ebd93 Adding in VaultEditor tests from old unittests 2014-10-21 16:40:44 -05:00
Toshio Kuratomi
c1b290a311 Fix logic that prevents multiple action, local_action, and modules to be specified. 2014-10-21 17:04:49 -04:00
Toshio Kuratomi
b3452de8a7 Hook up the general parsing unittests and get them passing 2014-10-21 16:06:40 -04:00
James Cammarata
0a8c91a812 Fixing up tests, removing some of the yaml error stuff from parsing
* moved old unittests for vault over to the new codebase
* reverted YAML error helpers and reverted the load() function
  in parsing/__init__.py, pending a rewrite of a new YAML loader
  class of some kind to encapsulate all of that
* fixed an error in in the module args parser regarding the shell/
  command argument parsing, where some additional arguments were
  being lost
2014-10-21 13:28:01 -05:00
Toshio Kuratomi
a954220957 Migrate the v2/tests to use the ansible.compat module 2014-10-21 01:14:30 -04:00
James Cammarata
b0069a338e Overhauls to v2 code
* using inspect module instead of iteritems(self.__class__.__dict__, due
  to the fact that the later does not include attributes from parent
  classes
* added tags/when attributes to Base() class for use by all subclasses
* removed value/callable code from Attribute, as they are not used
* started moving some limited code from utils to new places in v2 tree
  (vault, yaml-parsing related defs)
* re-added ability of Block.load() to create implicit blocks from tasks
* started overhaul of Role class and role-related code
2014-10-20 13:11:20 -05:00
Toshio Kuratomi
acf4bc95a3 Give all v2 tests the python3 compat boilerplate 2014-10-15 19:25:48 -04:00
Toshio Kuratomi
a707f5acfe Fix relative imports 2014-10-15 18:40:03 -04:00
Toshio Kuratomi
057c1df303 Remove temp file 2014-10-15 18:36:30 -04:00
Toshio Kuratomi
cf5ce97275 Somehow, git mv only rm'd test/v2 and didn't add v2/test 2014-10-15 18:35:16 -04:00