mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Working right now
This commit is contained in:
parent
700eaebad0
commit
f740a19477
2 changed files with 9 additions and 5 deletions
|
@ -59,10 +59,15 @@ class Beacon(object):
|
|||
log.trace('Skipping beacon {0}. Interval not reached.'.format(mod))
|
||||
continue
|
||||
if self._determine_beacon_config(mod, 'disable_during_state_run', b_config):
|
||||
log.trace('Evaluting if beacon {0} should be skipped due to a state run.'.format(mod))
|
||||
b_config = self._trim_config(b_config, mod, 'disable_during_state_run')
|
||||
is_running = map(re.compile('state.*').match, salt.utils.minion.running(self.opts))
|
||||
if [running.group(1) for running in is_running if running]:
|
||||
log.debug('Skipping beacon {0}. State run in progress.'.format(mod))
|
||||
is_running = False
|
||||
running_jobs = salt.utils.minion.running(self.opts)
|
||||
for job in running_jobs:
|
||||
if re.match('state.*', job['fun']):
|
||||
is_running = True
|
||||
if is_running:
|
||||
log.info('Skipping beacon {0}. State run in progress.'.format(mod))
|
||||
continue
|
||||
# Fire the beacon!
|
||||
raw = self.beacons[fun_str](b_config[mod])
|
||||
|
@ -85,7 +90,6 @@ class Beacon(object):
|
|||
b_config[mod].remove(b_config[0])
|
||||
elif isinstance(b_config[mod], dict):
|
||||
b_config[mod].pop(key)
|
||||
print('Returning b_config: {0}'.format(b_config))
|
||||
return b_config
|
||||
|
||||
def _determine_beacon_config(self, mod, val, config_mod):
|
||||
|
|
|
@ -17,7 +17,7 @@ def running(opts):
|
|||
ret = []
|
||||
proc_dir = os.path.join(opts['cachedir'], 'proc')
|
||||
if not os.path.isdir(proc_dir):
|
||||
return []
|
||||
return ret
|
||||
for fn_ in os.listdir(proc_dir):
|
||||
path = os.path.join(proc_dir, fn_)
|
||||
try:
|
||||
|
|
Loading…
Add table
Reference in a new issue