Fix test cdist_type.TypeTestCase.test_directory_in_default
This commit is contained in:
parent
9717d5d928
commit
2318c792d7
1 changed files with 6 additions and 4 deletions
|
@ -204,11 +204,13 @@ class CdistType(object):
|
||||||
try:
|
try:
|
||||||
defaults_dir = os.path.join(self.absolute_path, "parameter", "default")
|
defaults_dir = os.path.join(self.absolute_path, "parameter", "default")
|
||||||
for name in os.listdir(defaults_dir):
|
for name in os.listdir(defaults_dir):
|
||||||
with open(os.path.join(defaults_dir, name)) as fd:
|
try:
|
||||||
defaults[name] = fd.read().strip()
|
with open(os.path.join(defaults_dir, name)) as fd:
|
||||||
|
defaults[name] = fd.read().strip()
|
||||||
|
except EnvironmentError:
|
||||||
|
pass # Swallow errors raised by open() or read()
|
||||||
except EnvironmentError:
|
except EnvironmentError:
|
||||||
# error ignored
|
pass # Swallow error raised by os.listdir()
|
||||||
pass
|
|
||||||
finally:
|
finally:
|
||||||
self.__parameter_defaults = defaults
|
self.__parameter_defaults = defaults
|
||||||
return self.__parameter_defaults
|
return self.__parameter_defaults
|
||||||
|
|
Loading…
Reference in a new issue