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
b07ab419
Commit
b07ab419
authored
Jan 28, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix directory loading of host/group vars in v2
parent
4d9bf37a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletions
+21
-1
v2/ansible/vars/__init__.py
+21
-1
No files found.
v2/ansible/vars/__init__.py
View file @
b07ab419
...
...
@@ -236,7 +236,27 @@ class VariableManager:
basename of the file without the extension
'''
data
=
loader
.
load_from_file
(
path
)
if
os
.
path
.
isdir
(
path
):
data
=
dict
()
try
:
names
=
os
.
listdir
(
path
)
except
os
.
error
,
err
:
raise
AnsibleError
(
"This folder cannot be listed:
%
s:
%
s."
%
(
path
,
err
.
strerror
))
# evaluate files in a stable order rather than whatever
# order the filesystem lists them.
names
.
sort
()
# do not parse hidden files or dirs, e.g. .svn/
paths
=
[
os
.
path
.
join
(
path
,
name
)
for
name
in
names
if
not
name
.
startswith
(
'.'
)]
for
p
in
paths
:
_found
,
results
=
self
.
_load_inventory_file
(
path
=
p
,
loader
=
loader
)
data
=
self
.
_combine_vars
(
data
,
results
)
else
:
data
=
loader
.
load_from_file
(
path
)
name
=
self
.
_get_inventory_basename
(
path
)
return
(
name
,
data
)
...
...
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