From 7d69946d421caeaad21687b3d3dcf8e37e4dd51c Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 4 Oct 2017 08:59:02 -0400 Subject: correctd inventory_file to return full path fixes #31294 (cherry picked from commit dbae704d3cc8dbaddd8ac93c79da92b14f83319c) --- lib/ansible/inventory/data.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/ansible') 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) -- cgit v1.2.1