removing redundancy

This commit is contained in:
Khris Richardson 2014-06-05 21:52:37 -05:00
parent 0d7366ee70
commit 5af83395e4
3 changed files with 13 additions and 16 deletions

View File

@ -61,11 +61,11 @@ def _get_conn(profile):
'''
if profile:
etcd = __salt__['config.option']('profile')
host = etcd.get('etcd.host', '127.0.0.1')
port = etcd.get('etcd.port', 4001)
host = etcd.get('etcd.host')
port = etcd.get('etcd.port')
else:
host = __salt__['config.option']('etcd.host', '127.0.0.1')
port = __salt__['config.option']('etcd.port', 4001)
host = __salt__['config.option']('etcd.host')
port = __salt__['config.option']('etcd.port')
return salt.utils.etcd_util.get_conn(host, port)

View File

@ -62,12 +62,9 @@ key with all minions but override its value for a specific minion::
# Import python libs
import logging
# Import salt libs
import salt.utils
# Import third party libs
try:
from salt.utils import etcd_util
import salt.utils.etcd_util
HAS_LIBS = True
except ImportError:
HAS_LIBS = False
@ -91,11 +88,11 @@ def _get_conn(profile):
'''
if profile:
etcd = __salt__['config.option']('profile')
host = etcd.get('etcd.host', '127.0.0.1')
port = etcd.get('etcd.port', 4001)
host = etcd.get('etcd.host')
port = etcd.get('etcd.port')
else:
host = __salt__['config.option']('etcd.host', '127.0.0.1')
port = __salt__['config.option']('etcd.port', 4001)
host = __salt__['config.option']('etcd.host')
port = __salt__['config.option']('etcd.port')
return salt.utils.etcd_util.get_conn(host, port)

View File

@ -73,11 +73,11 @@ def _get_conn():
profile = __salt__['config.option']('etcd.returner', None)
if profile:
etcd = __salt__['config.option']('profile')
host = etcd.get('etcd.host', '127.0.0.1')
port = etcd.get('etcd.port', 4001)
host = etcd.get('etcd.host')
port = etcd.get('etcd.port')
else:
host = __salt__['config.option']('etcd.host', '127.0.0.1')
port = __salt__['config.option']('etcd.port', 4001)
host = __salt__['config.option']('etcd.host')
port = __salt__['config.option']('etcd.port')
return salt.utils.etcd_util.get_conn(host, port), path