Merge pull request #16601 from rallytime/bp-16591

Backport #16591 to 2014.7
This commit is contained in:
Thomas S Hatch 2014-10-13 17:39:07 -06:00
commit e603e18dd4

View File

@ -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):