From ab203f377d90548c6f69aad3ddc17b7096199125 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Fri, 2 Aug 2013 17:04:27 -0500 Subject: [PATCH] Fix traceback in salt-call --local This fixes #6502 by reverting 83c2e61 and removing the lines in salt.minion.get_proc_dir that clear out the proc dir, since this is not the desired behavior. --- salt/cli/caller.py | 5 ++++- salt/minion.py | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/salt/cli/caller.py b/salt/cli/caller.py index 6cce9cfd2e9c..bf1d528007f6 100644 --- a/salt/cli/caller.py +++ b/salt/cli/caller.py @@ -52,7 +52,10 @@ def call(self): ret = {} fun = self.opts['fun'] ret['jid'] = '{0:%Y%m%d%H%M%S%f}'.format(datetime.datetime.now()) - proc_fn = os.path.join(self.opts['cachedir'], 'proc', ret['jid']) + proc_fn = os.path.join( + salt.minion.get_proc_dir(self.opts['cachedir']), + ret['jid'] + ) if fun not in self.minion.functions: sys.stderr.write('Function {0} is not available\n'.format(fun)) sys.exit(-1) diff --git a/salt/minion.py b/salt/minion.py index 44a3f473b1f2..4549f0e63c72 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -109,10 +109,6 @@ def get_proc_dir(cachedir): if not os.path.isdir(fn_): # proc_dir is not present, create it os.makedirs(fn_) - else: - # proc_dir is present, clean out old proc files - for proc_fn in os.listdir(fn_): - os.remove(os.path.join(fn_, proc_fn)) return fn_