Skip to content

Loading…

Fix minion startup on 0.10.4+ for systems that have nodegroups defined. #2409

Merged
merged 2 commits into from

2 participants

@jcollie

No description provided.

jcollie added some commits
@jcollie jcollie Don't use a try/except block to check for functions which are unavail…
…able on the master.

The try/except block here can hide attribute exceptions further down
the call chain.  Instead, explicitly check for the function using
hasattr so that attribute exceptions further down will trigger
tracebacks.
f57ee14
@jcollie jcollie Look for the nodegroup_comp function in the correct module. f15a6f7
@thatch45 thatch45 merged commit c4a1a44 into saltstack:develop
@thatch45
Salt Stack member

Thanks for the fixes @jcollie!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 31, 2012
  1. @jcollie

    Don't use a try/except block to check for functions which are unavail…

    jcollie committed
    …able on the master.
    
    The try/except block here can hide attribute exceptions further down
    the call chain.  Instead, explicitly check for the function using
    hasattr so that attribute exceptions further down will trigger
    tracebacks.
  2. @jcollie
Showing with 4 additions and 4 deletions.
  1. +3 −3 salt/master.py
  2. +1 −1 salt/minion.py
View
6 salt/master.py
@@ -1055,11 +1055,11 @@ def run_func(self, func, load):
if func.startswith('__'):
return self.crypticle.dumps({})
# Run the func
- try:
+ if hasattr(self, func):
ret = getattr(self, func)(load)
- except AttributeError as exc:
+ else:
log.error(('Received function {0} which is unavailable on the '
- 'master, returning False').format(exc))
+ 'master, returning False').format(func))
return self.crypticle.dumps(False)
# Don't encrypt the return value for the _return func
# (we don't care about the return value, so why encrypt it?)
View
2 salt/minion.py
@@ -944,6 +944,6 @@ def nodegroup_match(self, tgt, nodegroups):
'''
if tgt in nodegroups:
return self.compound_match(
- salt.utils.nodegroup_comp(tgt, nodegroups)
+ salt.utils.minions.nodegroup_comp(tgt, nodegroups)
)
return False
Something went wrong with that request. Please try again.