If I have correctly read the code salt-master not only reads the master config file but also the minion configuration. With the "config" option you can only choose another master configuration file. The following is just an idea and not very well tested.
The patch changes the behavior of the "config" option. It points now
to the config dir and assumes, that the config files are named "master"
and "minion".
Signed-off-by: Matthias Teege <[email protected]>
---
salt/__init__.py | 8 ++++----
salt/master.py | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/salt/__init__.py b/salt/__init__.py
index 7572fc8..3ac2202 100644
--- a/salt/__init__.py
+++ b/salt/__init__.py
@@ -25,7 +25,7 @@ class Master(object):
'''
def __init__(self):
self.cli = self.__parse_cli()
- self.opts = salt.config.master_config(self.cli['config'])
+ self.opts = salt.config.master_config(self.cli['config'] + '/master')
def __parse_cli(self):
'''
@@ -41,7 +41,7 @@ class Master(object):
parser.add_option('-c',
'--config',
dest='config',
- default='/etc/salt/master',
+ default='/etc/salt',
help='Pass in an alternative configuration file')
options, args = parser.parse_args()
@@ -70,7 +70,7 @@ class Minion(object):
'''
def __init__(self):
self.cli = self.__parse_cli()
- self.opts = salt.config.minion_config(self.cli['config'])
+ self.opts = salt.config.minion_config(self.cli['config'] + '/minion')
def __parse_cli(self):
'''
@@ -86,7 +86,7 @@ class Minion(object):
parser.add_option('-c',
'--config',
dest='config',
- default='/etc/salt/minion',
+ default='/etc/salt',
help='Pass in an alternative configuration file')
options, args = parser.parse_args()
diff --git a/salt/master.py b/salt/master.py
index 01b4cc5..d6fe85e 100644
--- a/salt/master.py
+++ b/salt/master.py
@@ -112,7 +112,7 @@ class ReqServer(threading.Thread):
self.key = self.__prep_key()
self.crypticle = salt.crypt.Crypticle(self.opts['aes'])
# Make a client
- self.local = salt.client.LocalClient()
+ self.local = salt.client.LocalClient(opts['conf_file'])
def __prep_key(self):
'''
--
1.7.3.4