summaryrefslogtreecommitdiff
path: root/lib/ansible
diff options
context:
space:
mode:
authorBrian Coca <brian.coca+git@gmail.com>2017-10-04 08:59:02 -0400
committerBrian Coca <brian.coca+git@gmail.com>2017-10-04 11:54:25 -0400
commit7d69946d421caeaad21687b3d3dcf8e37e4dd51c (patch)
treed7799c01f988c2bd17b5f570cc5a39835ee81706 /lib/ansible
parente9183f1966795ca29af1378b41233d45f8c80b7c (diff)
downloadansible-7d69946d421caeaad21687b3d3dcf8e37e4dd51c.tar.gz
correctd inventory_file to return full path
fixes #31294 (cherry picked from commit dbae704d3cc8dbaddd8ac93c79da92b14f83319c)
Diffstat (limited to 'lib/ansible')
-rw-r--r--lib/ansible/inventory/data.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/ansible/inventory/data.py b/lib/ansible/inventory/data.py
index 4613141795..e828c1a8d2 100644
--- a/lib/ansible/inventory/data.py
+++ b/lib/ansible/inventory/data.py
@@ -19,7 +19,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
-import os
import sys
from ansible import constants as C
@@ -187,7 +186,7 @@ class InventoryData(object):
h = Host(host, port)
self.hosts[host] = h
if self.current_source: # set to 'first source' in which host was encountered
- self.set_variable(host, 'inventory_file', os.path.basename(self.current_source))
+ self.set_variable(host, 'inventory_file', self.current_source)
self.set_variable(host, 'inventory_dir', basedir(self.current_source))
else:
self.set_variable(host, 'inventory_file', None)