Better errors for mkdirp failure in mirror.
This commit is contained in:
parent
64a9549225
commit
be354e85c9
@ -147,7 +147,11 @@ def create(path, specs, **kwargs):
|
|||||||
# Get the absolute path of the root before we start jumping around.
|
# Get the absolute path of the root before we start jumping around.
|
||||||
mirror_root = os.path.abspath(path)
|
mirror_root = os.path.abspath(path)
|
||||||
if not os.path.isdir(mirror_root):
|
if not os.path.isdir(mirror_root):
|
||||||
mkdirp(mirror_root)
|
try:
|
||||||
|
mkdirp(mirror_root)
|
||||||
|
except OSError as e:
|
||||||
|
raise MirrorError(
|
||||||
|
"Cannot create directory '%s':" % mirror_root, str(e))
|
||||||
|
|
||||||
# Things to keep track of while parsing specs.
|
# Things to keep track of while parsing specs.
|
||||||
present = []
|
present = []
|
||||||
@ -164,7 +168,11 @@ def create(path, specs, **kwargs):
|
|||||||
# create a subdirectory for the current package@version
|
# create a subdirectory for the current package@version
|
||||||
archive_path = os.path.abspath(join_path(mirror_root, mirror_archive_path(spec)))
|
archive_path = os.path.abspath(join_path(mirror_root, mirror_archive_path(spec)))
|
||||||
subdir = os.path.dirname(archive_path)
|
subdir = os.path.dirname(archive_path)
|
||||||
mkdirp(subdir)
|
try:
|
||||||
|
mkdirp(subdir)
|
||||||
|
except OSError as e:
|
||||||
|
raise MirrorError(
|
||||||
|
"Cannot create directory '%s':" % subdir, str(e))
|
||||||
|
|
||||||
if os.path.exists(archive_path):
|
if os.path.exists(archive_path):
|
||||||
tty.msg("Already added %s" % spec.format("$_$@"))
|
tty.msg("Already added %s" % spec.format("$_$@"))
|
||||||
|
Loading…
Reference in New Issue
Block a user