提交 ade2d27d 编写于 作者: L Lukáš Doktor

utils.asset: Little optimization of _get_writable_cache_dir

Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 0fee03b6
...@@ -91,15 +91,11 @@ class Asset(object): ...@@ -91,15 +91,11 @@ class Asset(object):
:rtype: str :rtype: str
:raises: EnvironmentError :raises: EnvironmentError
""" """
result = None
for cache_dir in self.cache_dirs: for cache_dir in self.cache_dirs:
cache_dir = os.path.expanduser(cache_dir) cache_dir = os.path.expanduser(cache_dir)
if utils_path.usable_rw_dir(cache_dir): if utils_path.usable_rw_dir(cache_dir):
result = cache_dir return cache_dir
break raise EnvironmentError("Can't find a writable cache directory.")
if result is None:
raise EnvironmentError("Can't find a writable cache directory.")
return result
def fetch(self): def fetch(self):
""" """
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册