Commit graph

54 commits

Author SHA1 Message Date
Toshio Kuratomi
2af6314f57 Comment to clarify why we add one to the line and column recording 2015-04-10 04:09:50 -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
369bf0d214 No longer need AnsibleComposer 2015-04-02 12:35:50 -07:00
Toshio Kuratomi
bfae708bbf Port v2 to the PyYAML C extension 2015-04-02 11:21:55 -07:00
James Cammarata
0603b9c62c Merge branch 'v2_fixing' into devel
Conflicts:
	v2/ansible/playbook/helpers.py
2015-04-02 01:25:53 -05:00
James Cammarata
785c0c0c8c V2 fixing bugs 2015-04-02 01:19:21 -05: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
378dc561cb Possible fix for the first newline and triple newline problems 2015-03-30 22:47:56 -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
995aa8e24b Making task includes dynamic and fixing many other bugs
Dynamic task includes still need some work, this is a rough first version.
* doesn't work with handler sections of playbooks yet
* when using include + with*, the insertion order is backwards
* fix potential for task lists to be unsynchronized when using the linear
  strategy, as the include conditional could be predicated on an inventory
  variable
2015-02-12 18:17:16 +00:00
James Cammarata
31dd75de59 Fixing many bugs in v2
* delegate_to rudimentary support (still needs much more work)
* lots of other things
2015-02-09 16:56:38 -06:00
James Cammarata
171a67cfef Tweaking role path searching in v2 to be a bit more like v1 2015-01-29 10:56:04 -06:00
James Cammarata
4d9bf37afa Fixing some v2 inventory bugs 2015-01-28 13:21:52 -06:00
James Cammarata
bbd08cd0e2 Fixing more v2 issues with integration tests 2015-01-26 23:41:19 -06:00
James Cammarata
c60c295ada Adding more fixes for integration testing under v2 2015-01-19 16:18:46 -06:00
James Cammarata
02bc014bcd More work on getting integration tests running for v2 2015-01-15 01:14:22 -06:00
James Cammarata
2aeb79f45f Starting work on getting integration tests working on v2
This is incomplete work, and requires some minor tweeks to the integration
tests which are not included in this commit.
2015-01-12 16:07:01 -06:00
James Cammarata
1544dde932 Moving over all lookup plugins to v2 2015-01-09 09:37:45 -06:00
James Cammarata
065733ad93 Moving more action plugins over and fixing some bugs with role loading 2015-01-07 10:48:33 -06:00
James Cammarata
62d79568be Creating playbook executor and dependent classes 2014-12-29 10:46:47 -06:00
Veres Lajos
bf5d8ee678 typofixes - https://github.com/vlajos/misspell_fixer 2014-12-04 22:23:35 +00:00
James Cammarata
24bebd85b4 Adding v2 task/block iterator and some reorganizing 2014-11-08 01:44:21 -06:00
Toshio Kuratomi
f1267c0b05 Move from md5 to sha1 to work on fips-140 enabled systems 2014-11-06 21:28:04 -08:00
James Cammarata
229d49fe36 Adding new playbook objects for v2
* Playbook
* TaskInclude
2014-11-05 21:13:47 -06:00
James Cammarata
0ed9746db3 Adding Play class for v2 2014-11-04 15:16:53 -06:00
James Cammarata
3b0e64127d Refactoring role spec stuff into a dedicated parsing class
Also reworking tests to cut down on the number of patches required
by sub-classing the DataLoader() class and reworking the base object's
structure a bit to allow its use
2014-10-30 12:42:06 -05:00
Toshio Kuratomi
7055505227 Add python3 compat header 2014-10-28 20:44:21 -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
58defa5cce Adding role deps to v2 Role class and fixing some bugs 2014-10-28 00:15:02 -05:00
James Cammarata
7cb489eca3 Adding a data parsing class for v2 2014-10-24 14:06:43 -05:00
James Cammarata
be972225a5 Removing unnecessary import from v2 parsing init 2014-10-22 11:00:24 -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
James Cammarata
0ed97e4d11 Updating v2 Role class code 2014-10-21 10:12:45 -05:00
Toshio Kuratomi
4c86bd3ca6 Merge the vault tempfile fix to the v2 tree 2014-10-21 10:33:33 -04:00
Toshio Kuratomi
e78c5f925b Python3 fixes 2014-10-21 01:24:09 -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
eafa718be1 Remove inherit from object as it's no longer needed to determine new-style classes 2014-10-15 19:37:29 -04:00
Toshio Kuratomi
18f30b00ba Add python3-compat boiler to all core files 2014-10-15 19:22:54 -04:00
Toshio Kuratomi
938b2108d0 Move the v2 tests under the v2 tree 2014-10-15 18:08:28 -04:00
Michael DeHaan
ccd559137f add missing headers, rm the subtree of ansible/inventory as we wish to overhaul it. 2014-10-10 16:47:55 -04:00
James Cammarata
a50332fc8a Adding v2 error line support, and tests 2014-10-09 12:52:39 -05:00
Michael DeHaan
98ed69213b Error -> ParserError 2014-10-08 19:53:09 -04:00
Michael DeHaan
79f41d9c1a This makes the module args parser more functional to eliminate side effects and eliminiates the 'return None' error path
to make sure we are handling more use cases.  Some paths are not yet complete, including most likely handling of the 'raw'
module.
2014-10-08 19:46:34 -04:00
Michael DeHaan
56b6cb5328 Teaching objects to load themselves, making the JSON/YAML parsing ambidexterous. 2014-10-08 16:00:08 -04:00
James Cammarata
c83a833740 New v2 ModuleArgsParser code and fixing up tests/other task code 2014-10-08 10:35:58 -05:00