mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
Merge branch 'feature-200' of dsa-research.org:one into feature-200
This commit is contained in:
commit
06760708f0
@ -104,10 +104,12 @@ error_image_get:
|
||||
error_authorization:
|
||||
oss << "[ImageEnable] User not authorized to enable/disable image" <<
|
||||
" attributes, aborting call.";
|
||||
image->unlock();
|
||||
goto error_common;
|
||||
|
||||
error_enable:
|
||||
oss << "[ImageEnable] Cannot enable/disable image [" << iid << "]";
|
||||
image->unlock();
|
||||
goto error_common;
|
||||
|
||||
error_common:
|
||||
|
@ -84,6 +84,7 @@ error_image_get:
|
||||
error_authenticate:
|
||||
oss << "User doesn't exist, or not authorized to use image with " <<
|
||||
"ID = " << iid << " , ImageInfo call aborted.";
|
||||
image->unlock();
|
||||
goto error_common;
|
||||
|
||||
error_common:
|
||||
|
@ -98,6 +98,7 @@ error_image_get:
|
||||
error_authorization:
|
||||
oss << "[ImagePublish] User not authorized to publish/unpublish image" <<
|
||||
", aborting call.";
|
||||
image->unlock();
|
||||
goto error_common;
|
||||
|
||||
error_common:
|
||||
|
@ -103,11 +103,13 @@ error_image_get:
|
||||
error_authorization:
|
||||
oss << "[ImageRemoveAttribute] User not authorized to remove image" <<
|
||||
" attributes aborting call.";
|
||||
image->unlock();
|
||||
goto error_common;
|
||||
|
||||
error_remove_attribute:
|
||||
oss << "[ImageRemoveAttribute] Cannot remove attribute with name = "
|
||||
<< name << " for image [" << iid << "]";
|
||||
image->unlock();
|
||||
goto error_common;
|
||||
|
||||
error_common:
|
||||
|
@ -109,10 +109,12 @@ error_image_get:
|
||||
error_authorization:
|
||||
oss << "User not authorized to modify image attributes " <<
|
||||
", aborting ImageUpdate call.";
|
||||
image->unlock();
|
||||
goto error_common;
|
||||
|
||||
error_update:
|
||||
oss << "Cannot modify image [" << iid << "] attribute with name = " << name;
|
||||
image->unlock();
|
||||
goto error_common;
|
||||
|
||||
error_common:
|
||||
|
@ -98,6 +98,7 @@ error_vn_get:
|
||||
error_authorization:
|
||||
oss << "[VirtualNetworkPublish] User not authorized to (un)publish VN" <<
|
||||
", aborting call.";
|
||||
vn->unlock();
|
||||
goto error_common;
|
||||
|
||||
error_common:
|
||||
|
@ -50,19 +50,8 @@ int TemplateSQL::insert_cb(void *nil, int num, char **values, char **names)
|
||||
|
||||
int TemplateSQL::insert(SqlDB * db)
|
||||
{
|
||||
ostringstream oss;
|
||||
int rc;
|
||||
|
||||
// Get next id from the DB table
|
||||
set_callback(
|
||||
static_cast<Callbackable::Callback>(&TemplateSQL::insert_cb));
|
||||
|
||||
oss << "SELECT MAX(id) FROM " << table;
|
||||
|
||||
rc = db->exec(oss,this);
|
||||
|
||||
unset_callback();
|
||||
|
||||
if ( rc != 0 )
|
||||
{
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user