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,
'commit': True, 'verbose': False},
'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
'''
# Import Python libs
import os
import logging
# Import Salt libs
import salt.utils
log = logging.getLogger(__name__)
@ -23,22 +26,14 @@ def _config_file():
'''
Return the config file location to use
'''
if 'poudriere.config' in __opts__:
return __opts__['poudriere.config']
elif 'poudriere.config' in __pillar__:
return __pillar__['poudriere.config']
return '/usr/local/etc/poudriere.conf'
return __salt__['config.option']('poudriere.config')
def _config_dir():
'''
Return the configuration directory to use
'''
if 'poudriere.config' in __opts__:
return __opts__['poudriere.config_dir']
elif 'poudriere.config' in __pillar__:
return __pillar__['poudriere.config_dir']
return '/usr/local/etc/poudriere.d'
return __salt__['config.option']('poudriere.config_dir')
def _check_config_exists(config_file=None):