From a75d8d49704b59c34ba5a6f1d12f1ebf37fcc9cf Mon Sep 17 00:00:00 2001 From: Andy Boyett Date: Thu, 24 Mar 2016 02:18:43 -0700 Subject: expand the use of '~' in cache path location Apply a bit more intelligence to the config parser. This allows the cache files to be anchored within a homedir. [cache] path = ~/.ansible/tmp --- foreman_ansible_inventory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 foreman_ansible_inventory.py diff --git a/foreman_ansible_inventory.py b/foreman_ansible_inventory.py old mode 100644 new mode 100755 index 461146c..e2a53c3 --- a/foreman_ansible_inventory.py +++ b/foreman_ansible_inventory.py @@ -107,7 +107,7 @@ class ForemanInventory(object): # Cache related try: - cache_path = config.get('cache', 'path') + cache_path = os.path.expanduser(config.get('cache', 'path')) except (ConfigParser.NoOptionError, ConfigParser.NoSectionError): cache_path = '.' (script, ext) = os.path.splitext(os.path.basename(__file__)) -- cgit v1.2.3