From 3a7c134bcb900db7100163c7e57749979e7461b8 Mon Sep 17 00:00:00 2001 From: Thomas S Hatch Date: Thu, 1 Nov 2012 16:22:35 -0600 Subject: [PATCH] Add config.option components to poudriere ex module --- salt/modules/config.py | 4 +++- salt/modules/poudriere.py | 15 +++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/salt/modules/config.py b/salt/modules/config.py index 1a21927ba9..315275312f 100644 --- a/salt/modules/config.py +++ b/salt/modules/config.py @@ -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', } diff --git a/salt/modules/poudriere.py b/salt/modules/poudriere.py index a5b7f847df..d29139206c 100644 --- a/salt/modules/poudriere.py +++ b/salt/modules/poudriere.py @@ -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):