mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Stop chdir() in pcre minions
This commit is contained in:
parent
f4a28a77f6
commit
2c89983424
@ -141,12 +141,12 @@ class CkMinions(object):
|
|||||||
'''
|
'''
|
||||||
Return the minions found by looking via regular expressions
|
Return the minions found by looking via regular expressions
|
||||||
'''
|
'''
|
||||||
cwd = os.getcwd()
|
try:
|
||||||
os.chdir(os.path.join(self.opts['pki_dir'], self.acc))
|
minions = os.listdir(os.path.join(self.opts['pki_dir'], self.acc))
|
||||||
reg = re.compile(expr)
|
reg = re.compile(expr)
|
||||||
ret = [fn_ for fn_ in os.listdir('.') if reg.match(fn_)]
|
return [m for m in minions if reg.match(m)]
|
||||||
os.chdir(cwd)
|
except OSError:
|
||||||
return ret
|
return []
|
||||||
|
|
||||||
def _check_cache_minions(self,
|
def _check_cache_minions(self,
|
||||||
expr,
|
expr,
|
||||||
|
Loading…
Reference in New Issue
Block a user