Don't try to mkdir upstream directory when nonexistent (#30744)
When an upstream is specified but the directory does not exist, don't create the directory for it, it might not be yours.
This commit is contained in:
parent
f5250da611
commit
8fe39be3df
@ -356,10 +356,10 @@ def __init__(self, root, db_dir=None, upstream_dbs=None,
|
|||||||
self.prefix_fail_path = os.path.join(self._db_dir, 'prefix_failures')
|
self.prefix_fail_path = os.path.join(self._db_dir, 'prefix_failures')
|
||||||
|
|
||||||
# Create needed directories and files
|
# Create needed directories and files
|
||||||
if not os.path.exists(self._db_dir):
|
if not is_upstream and not os.path.exists(self._db_dir):
|
||||||
fs.mkdirp(self._db_dir)
|
fs.mkdirp(self._db_dir)
|
||||||
|
|
||||||
if not os.path.exists(self._failure_dir) and not is_upstream:
|
if not is_upstream and not os.path.exists(self._failure_dir):
|
||||||
fs.mkdirp(self._failure_dir)
|
fs.mkdirp(self._failure_dir)
|
||||||
|
|
||||||
self.is_upstream = is_upstream
|
self.is_upstream = is_upstream
|
||||||
|
Loading…
Reference in New Issue
Block a user