diff options
| author | Kenny Woodson <kwoodson@redhat.com> | 2015-12-14 16:13:30 -0500 | 
|---|---|---|
| committer | Kenny Woodson <kwoodson@redhat.com> | 2015-12-14 17:11:15 -0500 | 
| commit | ba08cf8c8e2138ae5de60fb28df7f50d3f45b5cf (patch) | |
| tree | 3b4e66ebb0d25189bdac062a3eab0b27ae7d592f /inventory | |
| parent | e4ecb0ea7415e0db3957926e5c6a571c36e2ffd1 (diff) | |
| download | openshift-ba08cf8c8e2138ae5de60fb28df7f50d3f45b5cf.tar.gz openshift-ba08cf8c8e2138ae5de60fb28df7f50d3f45b5cf.tar.bz2 openshift-ba08cf8c8e2138ae5de60fb28df7f50d3f45b5cf.tar.xz openshift-ba08cf8c8e2138ae5de60fb28df7f50d3f45b5cf.zip  | |
Updates to ohi to pull cache if specified.  Also require version
Diffstat (limited to 'inventory')
| -rwxr-xr-x | inventory/multi_inventory.py | 18 | 
1 files changed, 9 insertions, 9 deletions
diff --git a/inventory/multi_inventory.py b/inventory/multi_inventory.py index 232f2402d..20fc48aa9 100755 --- a/inventory/multi_inventory.py +++ b/inventory/multi_inventory.py @@ -56,15 +56,6 @@ class MultiInventory(object):          else:              self.config_file = None # expect env vars - -    def run(self): -        '''This method checks to see if the local -           cache is valid for the inventory. - -           if the cache is valid; return cache -           else the credentials are loaded from multi_inventory.yaml or from the env -           and we attempt to get the inventory from the provider specified. -        '''          # load yaml          if self.config_file and os.path.isfile(self.config_file):              self.config = self.load_yaml_config() @@ -91,6 +82,15 @@ class MultiInventory(object):          if self.config.has_key('cache_location'):              self.cache_path = self.config['cache_location'] +    def run(self): +        '''This method checks to see if the local +           cache is valid for the inventory. + +           if the cache is valid; return cache +           else the credentials are loaded from multi_inventory.yaml or from the env +           and we attempt to get the inventory from the provider specified. +        ''' +          if self.args.get('refresh_cache', None):              self.get_inventory()              self.write_to_cache()  | 
