summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorWayne Witzel III <wayne@riotousliving.com>2016-04-05 11:14:28 -0400
committerMatt Clay <matt@mystile.com>2017-04-03 21:22:29 -0700
commit1a1e12cf46a81f491b4daddbb3dcaf1bf0f65227 (patch)
treeb8dd7b9dded63ace928a9e255d40c88d5010e00e /contrib
parentb7cc4616b12946cc4f583f9c21efd0222fbb2951 (diff)
downloadansible-1a1e12cf46a81f491b4daddbb3dcaf1bf0f65227.tar.gz
fetch spacewalk.ini from the environment if set
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/inventory/spacewalk.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/inventory/spacewalk.py b/contrib/inventory/spacewalk.py
index 2735a81250..10a7dc9488 100755
--- a/contrib/inventory/spacewalk.py
+++ b/contrib/inventory/spacewalk.py
@@ -57,10 +57,13 @@ except:
import simplejson as json
base_dir = os.path.dirname(os.path.realpath(__file__))
+default_ini_file = os.path.join(base_dir, "spacewalk.ini")
+
SW_REPORT = '/usr/bin/spacewalk-report'
CACHE_DIR = os.path.join(base_dir, ".spacewalk_reports")
CACHE_AGE = 300 # 5min
-INI_FILE = os.path.join(base_dir, "spacewalk.ini")
+INI_FILE = os.path.expanduser(os.path.expandvars(os.environ.get("SPACEWALK_INI_PATH", default_ini_file)))
+
# Sanity check
if not os.path.exists(SW_REPORT):