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
e8452c86
Commit
e8452c86
authored
Aug 06, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore the relative path handling portion of #11865
parent
26d5a17b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
lib/ansible/parsing/__init__.py
+4
-0
test/units/mock/loader.py
+3
-3
No files found.
lib/ansible/parsing/__init__.py
View file @
e8452c86
...
...
@@ -112,15 +112,19 @@ class DataLoader():
return
parsed_data
def
path_exists
(
self
,
path
):
path
=
self
.
path_dwim
(
path
)
return
os
.
path
.
exists
(
path
)
def
is_file
(
self
,
path
):
path
=
self
.
path_dwim
(
path
)
return
os
.
path
.
isfile
(
path
)
def
is_directory
(
self
,
path
):
path
=
self
.
path_dwim
(
path
)
return
os
.
path
.
isdir
(
path
)
def
list_directory
(
self
,
path
):
path
=
self
.
path_dwim
(
path
)
return
os
.
listdir
(
path
)
def
_safe_load
(
self
,
stream
,
file_name
=
None
):
...
...
test/units/mock/loader.py
View file @
e8452c86
...
...
@@ -29,11 +29,11 @@ class DictDataLoader(DataLoader):
def
__init__
(
self
,
file_mapping
=
dict
()):
assert
type
(
file_mapping
)
==
dict
super
(
DictDataLoader
,
self
)
.
__init__
()
self
.
_file_mapping
=
file_mapping
self
.
_build_known_directories
()
super
(
DictDataLoader
,
self
)
.
__init__
()
def
load_from_file
(
self
,
path
):
if
path
in
self
.
_file_mapping
:
return
self
.
load
(
self
.
_file_mapping
[
path
],
path
)
...
...
@@ -73,7 +73,7 @@ class DictDataLoader(DataLoader):
rebuild_dirs
=
False
if
path
not
in
self
.
_file_mapping
:
rebuild_dirs
=
True
self
.
_file_mapping
[
path
]
=
content
if
rebuild_dirs
:
...
...
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