Bug #2093: Make messages to get a resource by _uid _id similar

(cherry picked from commit ae116531f80c1f5c8f4487039e95ee12c8ef9af9)
This commit is contained in:
Carlos Martín authored and Ruben S. Montero committed 2013-07-23 16:20:52 +02:00
1 parent d78cbaf17a
commit a90cb0e7a0
2 files changed
+25 -4

No files matched your search

+2 -1
View File
@@ -64,7 +64,8 @@ Image * ImageManager::acquire_image(int vm_id, const string& name, int uid, stri
if ( img == 0 )
{
ostringstream oss;
oss << "Image " << name << " does not exist for user " << uid;
oss << "User " << uid << " does not own an image with name: " << name
<< " . Set IMAGE_UNAME or IMAGE_UID of owner in DISK.";
error = oss.str();
return 0;
+23 -3
View File
@@ -117,6 +117,17 @@ int get_image_path(VirtualMachine * vm,
}
img = ipool->get(val1, uid, true);
if ( img == 0 )
{
ostringstream oss;
oss << "User " << uid << " does not own an image with name: " << val1
<< " . Set IMAGE_UNAME or IMAGE_UID of owner.";
error_str = oss.str();
return -1;
}
}
else if ( var1 == "IMAGE_ID" )
{
@@ -126,11 +137,20 @@ int get_image_path(VirtualMachine * vm,
{
img = ipool->get(iid, true);
}
}
if ( img == 0 )
if ( img == 0 )
{
ostringstream oss;
oss << "Image with ID: " << iid << " does not exist";
error_str = oss.str();
return -1;
}
}
else
{
error_str = "Cannot get image (check name/ID or try IMAGE_UNAME or IMAGE_UID).";
error_str = "Cannot get image, set IMAGE_ID or IMAGE.";
return -1;
}