Skip to content

Commit

Permalink
Fix minigraph_facts: mkdir recursively (#533)
Browse files Browse the repository at this point in the history
Signed-off-by: Qi Luo <[email protected]>
  • Loading branch information
qiluo-msft authored and lguohan committed Mar 27, 2018
1 parent 6e56d0b commit 6c7b44c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ansible/library/minigraph_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,11 +607,11 @@ def main():

try:
# make the directory for caching the mini-graph.
os.mkdir(ANSIBLE_USER_MINIGRAPH_PATH)
os.makedirs(ANSIBLE_USER_MINIGRAPH_PATH)
except OSError:
if not os.path.isdir(ANSIBLE_USER_MINIGRAPH_PATH):
# file conflict, report the error and exit.
module.fail_json(msg="'{}' exists but is not a directory".format(ANSIBLE_USER_MINIGRAPH_PATH))
module.fail_json(msg="Cannot create dir: {}".format(ANSIBLE_USER_MINIGRAPH_PATH))

m_args = module.params
local_file_path = ANSIBLE_LOCAL_MINIGRAPH_PATH.format(m_args['host'])
Expand Down

0 comments on commit 6c7b44c

Please sign in to comment.