From 51a180b150da411787f6209521cf8abbac8b8b0d Mon Sep 17 00:00:00 2001 From: ftao Date: Sun, 11 Aug 2013 10:50:47 +0800 Subject: [PATCH] fix inventory.basedir is not absolute path when hostfile is startswith "./" --- lib/ansible/inventory/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/inventory/__init__.py b/lib/ansible/inventory/__init__.py index 1661fbef22..334beb6dc8 100644 --- a/lib/ansible/inventory/__init__.py +++ b/lib/ansible/inventory/__init__.py @@ -392,7 +392,7 @@ class Inventory(object): if not self.is_file(): return None dname = os.path.dirname(self.host_list) - if dname is None or dname == '': + if dname is None or dname == '' or dname == '.': cwd = os.getcwd() return cwd return dname