mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
fix absent key dir
This commit is contained in:
parent
a44bb73a2f
commit
9987bb7a97
10
salt/key.py
10
salt/key.py
@ -547,9 +547,13 @@ class Key(object):
|
||||
ret = {}
|
||||
for dir_ in acc, pre, rej:
|
||||
ret[os.path.basename(dir_)] = []
|
||||
for fn_ in salt.utils.isorted(os.listdir(dir_)):
|
||||
if os.path.isfile(os.path.join(dir_, fn_)):
|
||||
ret[os.path.basename(dir_)].append(fn_)
|
||||
try:
|
||||
for fn_ in salt.utils.isorted(os.listdir(dir_)):
|
||||
if os.path.isfile(os.path.join(dir_, fn_)):
|
||||
ret[os.path.basename(dir_)].append(fn_)
|
||||
except (OSError, IOError):
|
||||
# key dir kind is not created yet, just skip
|
||||
continue
|
||||
return ret
|
||||
|
||||
def all_keys(self):
|
||||
|
Loading…
Reference in New Issue
Block a user