Add config.option components to poudriere ex module

This commit is contained in:
Thomas S Hatch 2012-11-01 16:22:35 -06:00
parent eb0733e497
commit 3a7c134bcb
2 changed files with 8 additions and 11 deletions

View File

@ -25,7 +25,9 @@ defaults = {'mongo.db': 'salt',
'solr.dih.import_options': {'clean': False, 'optimize': True, 'solr.dih.import_options': {'clean': False, 'optimize': True,
'commit': True, 'verbose': False}, 'commit': True, 'verbose': False},
'solr.backup_path': None, 'solr.backup_path': None,
'solr.num_backups': 1 'solr.num_backups': 1,
'poudriere.config': '/usr/local/etc/poudriere.conf',
'poudriere.config_dir': '/usr/local/etc/poudriere.d',
} }

View File

@ -1,9 +1,12 @@
''' '''
Support for poudriere Support for poudriere
''' '''
# Import Python libs
import os import os
import logging import logging
# Import Salt libs
import salt.utils import salt.utils
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -23,22 +26,14 @@ def _config_file():
''' '''
Return the config file location to use Return the config file location to use
''' '''
if 'poudriere.config' in __opts__: return __salt__['config.option']('poudriere.config')
return __opts__['poudriere.config']
elif 'poudriere.config' in __pillar__:
return __pillar__['poudriere.config']
return '/usr/local/etc/poudriere.conf'
def _config_dir(): def _config_dir():
''' '''
Return the configuration directory to use Return the configuration directory to use
''' '''
if 'poudriere.config' in __opts__: return __salt__['config.option']('poudriere.config_dir')
return __opts__['poudriere.config_dir']
elif 'poudriere.config' in __pillar__:
return __pillar__['poudriere.config_dir']
return '/usr/local/etc/poudriere.d'
def _check_config_exists(config_file=None): def _check_config_exists(config_file=None):