Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
8d154990
Commit
8d154990
authored
Jul 17, 2015
by
Serge van Ginderachter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix AnsibleError object name in subelements plugin
fixes #11624
parent
bc5a7fce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
lib/ansible/plugins/lookup/subelements.py
+5
-5
No files found.
lib/ansible/plugins/lookup/subelements.py
View file @
8d154990
...
...
@@ -30,7 +30,7 @@ class LookupModule(LookupBase):
def
run
(
self
,
terms
,
variables
,
**
kwargs
):
def
_raise_terms_error
(
msg
=
""
):
raise
errors
.
AnsibleError
(
raise
AnsibleError
(
"subelements lookup expects a list of two or three items, "
+
msg
)
terms
=
listify_lookup_plugin_terms
(
terms
,
variables
,
loader
=
self
.
_loader
)
...
...
@@ -66,7 +66,7 @@ class LookupModule(LookupBase):
ret
=
[]
for
item0
in
elementlist
:
if
not
isinstance
(
item0
,
dict
):
raise
errors
.
AnsibleError
(
"subelements lookup expects a dictionary, got '
%
s'"
%
item0
)
raise
AnsibleError
(
"subelements lookup expects a dictionary, got '
%
s'"
%
item0
)
if
item0
.
get
(
'skipped'
,
False
)
is
not
False
:
# this particular item is to be skipped
continue
...
...
@@ -82,18 +82,18 @@ class LookupModule(LookupBase):
if
skip_missing
:
continue
else
:
raise
errors
.
AnsibleError
(
"could not find '
%
s' key in iterated item '
%
s'"
%
(
subkey
,
subvalue
))
raise
AnsibleError
(
"could not find '
%
s' key in iterated item '
%
s'"
%
(
subkey
,
subvalue
))
if
not
lastsubkey
:
if
not
isinstance
(
subvalue
[
subkey
],
dict
):
if
skip_missing
:
continue
else
:
raise
errors
.
AnsibleError
(
"the key
%
s should point to a dictionary, got '
%
s'"
%
(
subkey
,
subvalue
[
subkey
]))
raise
AnsibleError
(
"the key
%
s should point to a dictionary, got '
%
s'"
%
(
subkey
,
subvalue
[
subkey
]))
else
:
subvalue
=
subvalue
[
subkey
]
else
:
# lastsubkey
if
not
isinstance
(
subvalue
[
subkey
],
list
):
raise
errors
.
AnsibleError
(
"the key
%
s should point to a list, got '
%
s'"
%
(
subkey
,
subvalue
[
subkey
]))
raise
AnsibleError
(
"the key
%
s should point to a list, got '
%
s'"
%
(
subkey
,
subvalue
[
subkey
]))
else
:
sublist
=
subvalue
.
pop
(
subkey
,
[])
for
item1
in
sublist
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment