Commit Graph

24 Commits (ec14572a60bd901bb52f80c2f0dbdaf1ada0eb8a)

Author SHA1 Message Date
James Cammarata af96cba7e1 Fix for bug in Conditional for older jinja2 versions
Fixes #20309
2017-01-16 13:06:09 -06:00
James Cammarata b7cdc21aee Additional security fixes for CVE-2016-9587 2017-01-13 16:22:53 -06:00
James Cammarata d316068831 Additional fixes for security related to CVE-2016-9587 2017-01-11 15:53:04 -06:00
James Cammarata a6fff93967 Fixing security bugs for CVE-2016-9587 2017-01-09 10:43:03 -06:00
James Cammarata 81aa12eb1b Rework how the Conditional class deals with undefined vars
Previously, the Conditional class did a simple check when an
AnsibleUndefinedVariable error was raised to see if certain strings were
present. This patch tries to be smarter by evaluating the variable contained
in the error string and compared to the defined/not defined conditionals in
the conditional string.

This also modifies the UndefinedError message from HostVars slightly to
match the format returned jinja2 in general, making it easier to match the
error message in the Conditional code.

Fixes #18514
2016-11-22 08:29:58 -06:00
James Cammarata 8ee3ef587a Check for negative defined logic in conditionals 2016-11-21 10:39:46 -06:00
James Cammarata 435ca620b2 Add option to prepend inherited attributes when extending values
Fixes #18483
2016-11-14 16:33:01 -06:00
James Cammarata 5b87951d6c Don't copy the parent block of TaskIncludes when loading statically
When loading an include statically, we previously were simply doing a
copy() of the TaskInclude object, which recurses up the parents creating
a new lineage of objects. This caused problems when used inside load_list_of_blocks
as the new parent Block of the new TaskInclude was not actually in the list
of blocks being operated on. In most circumstances, this did not cause a
problem as the new parent block was a proper copy, however when used in
combination with PlaybookInclude (which copies conditionals to the list of
blocks loaded) this untracked parent was not being properly updated, leading
to tasks being run improperly.

Fixes #18206
2016-11-11 08:09:43 -06:00
James Cammarata 5a57c66e3c Moving result reading to a background thread 2016-09-17 08:12:52 -05:00
Brian Coca 4457985062 added ability to use pure boolean in conditionals 2016-09-02 08:54:38 -04:00
Dag Wieers a5e11b1325 Another misspelling
...while reading the source
2016-03-10 03:24:04 +01:00
James Cammarata 3ec0104128 Fixing bugs in conditional testing with until and some integration runner tweaks 2015-12-19 21:14:48 -05:00
Brian Coca c64298de02 Revert "avoid persistent containers in attribute defaults"
This reverts commit 87969868d4.
found better way to do it
2015-12-09 08:40:06 -08:00
Brian Coca 87969868d4 avoid persistent containers in attribute defaults
moved from the field attribute declaration and created a placeholder
which then is resolved in the field attribute class.

this is to avoid unwanted persistent of the defaults across objects which introduces
stealth bugs when multiple objects of the same kind are used in succession while
not overriding the default values.
2015-12-09 07:29:36 -08: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 8e664ad226 Fix delegate_to localhost vs. 127.0.0.1 (and ::1) 2015-09-15 13:08:54 -04:00
Marius Gedminas 37be9539ff Python 3: use six.text_type instead of unicode
Replace 'unicode' with six.text_type, everywhere but in module_utils.
2015-09-04 08:40:10 +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
James Cammarata 829a88b906 Disable undefined error failures during conditional templating
This allows us to properly catch the 'is defined' and 'is undefined'
checks and return the correct boolean result.

Fixes #11892
2015-08-12 07:37:03 -04:00
James Cammarata 9d9cd0c42c Handle getting the ds for Conditionals which may not be mixed in 2015-06-28 00:30:27 -04:00
James Cammarata 8ef28253e3 Properly catch and report conditional test failures 2015-06-27 15:37:10 -04:00
James Cammarata ff998b6022 Make sure the templar is using the right vars when evaluating conditionals 2015-06-17 00:10:11 -04:00
James Cammarata 803fb397f3 Fixing filter plugins directory from switch 2015-05-04 01:33:10 -05:00
James Cammarata ce3ef7f4c1 Making the switch to v2 2015-05-03 21:47:26 -05:00