Improve exception message

Using python-muranoclient you can get an exception that doesn't
give needed information. Add this information to it.

Change-Id: Ic94a131e7cf0d25f10eb827df233a1c2f59ba9c3
Closes-bug: #1416021
This commit is contained in:
Roman Vasilets
2015-01-29 19:48:57 +02:00
parent ba9f2d5619
commit c49cec2fba

View File

@@ -44,8 +44,8 @@ def load_from_file(archive_path, target_dir=None, drop_dir=False,
try:
if not zipfile.is_zipfile(archive_path):
raise e.PackageFormatError("Uploading file should be a "
"zip' archive")
raise e.PackageFormatError("Uploaded file {0} is not a "
"zip archive".format(archive_path))
package = zipfile.ZipFile(archive_path)
package.extractall(path=target_dir)
return load_from_dir(target_dir, preload=True, loader=loader)