1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-11 05:17:41 +03:00

bug #274: work on the error messages

This commit is contained in:
Ruben S. Montero 2010-08-06 00:40:18 +02:00
parent 3347c51489
commit f16f88a6e9
14 changed files with 30 additions and 30 deletions

View File

@ -60,12 +60,12 @@ int ClusterPool::allocate(int * clid, string name, SqlDB *db, string& error_str)
error_existing_name:
oss << "Could not allocate new cluster: Name \""
<< name << "\" already exists";
oss << "Could not allocate new cluster: "
<< name << ", already exists.";
goto error_common;
error_db:
oss << "Could not allocate new cluster \"" << name;
oss << "Could not allocate new cluster " << name << ".";
goto error_common;
error_common:

View File

@ -167,7 +167,7 @@ int Host::insert(SqlDB *db, string& error_str)
if ( rc != 0 )
{
error_str = "Error inserting Host in DB";
error_str = "Error inserting Host in DB.";
host_share.drop(db);
return rc;

View File

@ -205,7 +205,7 @@ int HostShare::insert(SqlDB * db, string& error_str)
if ( rc == -1 )
{
error_str = "Error inserting Host Share in DB";
error_str = "Error inserting Host Share in DB.";
}
return rc;

View File

@ -248,21 +248,21 @@ int Image::insert(SqlDB *db, string& error_str)
if ( rc == -1 )
{
error_str = "Error inserting Image in DB";
error_str = "Error inserting Image in DB.";
}
return rc;
error_name:
error_str = "NAME not present in image template";
error_str = "NAME not present in image template.";
goto error_common;
error_type:
error_str = "Incorrect TYPE in image template";
error_str = "Incorrect TYPE in image template.";
goto error_common;
error_public_and_persistent:
error_str = "Image cannot be public and persistant";
error_str = "Image cannot be public and persistant.";
goto error_common;
error_common:

View File

@ -167,7 +167,7 @@ error_parse:
error_allocate:
oss << action_error(method_name, "CREATE", "VM", -2, 0);
oss << ". " << error_str;
oss << " " << error_str;
goto error_common;
error_common:

View File

@ -97,7 +97,7 @@ error_authorize:
error_cluster_allocate:
oss << action_error(method_name, "CREATE", "CLUSTER", -2, 0);
oss << ". " << error_str;
oss << " " << error_str;
goto error_common;
error_common:

View File

@ -109,7 +109,7 @@ error_authorize:
error_host_allocate:
oss << action_error(method_name, "CREATE", "HOST", -2, 0);
oss << ". " << error_str;
oss << " " << error_str;
goto error_common;
error_common:

View File

@ -140,7 +140,7 @@ error_parse:
error_allocate:
oss << action_error(method_name, "CREATE", "IMAGE", -2, 0);
oss << ". " << error_str;
oss << " " << error_str;
goto error_common;
error_common:

View File

@ -120,7 +120,7 @@ error_duplicate:
error_allocate:
oss << action_error(method_name, "CREATE", "USER", -2, 0);
oss << ". " << error_str;
oss << " " << error_str;
goto error_common;
error_common:

View File

@ -140,7 +140,7 @@ error_parse:
error_vn_allocate:
oss << action_error(method_name, "CREATE", "NET", -2, 0);
oss << ". " << error_str;
oss << " " << error_str;
goto error_common;
error_common:

View File

@ -119,7 +119,7 @@ int User::insert(SqlDB *db, string& error_str)
if ( rc != 0 )
{
error_str = "Error inserting User in DB";
error_str = "Error inserting User in DB.";
return rc;
}

View File

@ -348,11 +348,11 @@ int VirtualMachine::insert(SqlDB * db, string& error_str)
return 0;
error_update:
error_str = "Can not insert VM in the database";
error_str = "Can not insert VM in the database.";
goto error_common;
error_leases:
error_str = "Could not get network lease for VM";
error_str = "Could not get network lease for VM.";
NebulaLog::log("ONE",Log::ERROR, error_str);
release_network_leases();
return -1;
@ -361,11 +361,11 @@ error_images:
goto error_common;
error_context:
error_str = "Could not parse CONTEXT for VM";
error_str = "Could not parse CONTEXT for VM.";
goto error_common;
error_requirements:
error_str = "Could not parse REQUIREMENTS for VM";
error_str = "Could not parse REQUIREMENTS for VM.";
goto error_common;
error_common:
@ -894,7 +894,7 @@ error_max_db:
goto error_common;
error_image:
error_str = "Could not get disk image for VM";
error_str = "Could not get disk image for VM.";
error_common:
NebulaLog::log("ONE",Log::ERROR, error_str);

View File

@ -349,7 +349,7 @@ int Leases::drop(SqlDB * db)
int Leases::insert(SqlDB * db, string& error_str)
{
error_str = "Should not access to Leases.insert()";
error_str = "Should not access to Leases.insert().";
NebulaLog::log("VNM", Log::ERROR, error_str);
return -1;
}

View File

@ -327,7 +327,6 @@ int VirtualNetwork::insert(SqlDB * db, string& error_str)
//--------------------------------------------------------------------------
// Insert the Virtual Network
//--------------------------------------------------------------------------
rc = insert_replace(db, false);
if ( rc != 0 )
@ -338,7 +337,6 @@ int VirtualNetwork::insert(SqlDB * db, string& error_str)
//--------------------------------------------------------------------------
// Get the leases
//--------------------------------------------------------------------------
if (type == VirtualNetwork::RANGED)
{
string nclass = "";
@ -401,32 +399,34 @@ int VirtualNetwork::insert(SqlDB * db, string& error_str)
return 0;
error_type:
ose << "Wrong type in template for Virtual Network id " << oid;
ose << "Wrong type in template for Virtual Network, id: ";
goto error_common;
error_name:
ose << "No NAME in template for Virtual Network id " << oid;
ose << "No NAME in template for Virtual Network, id: ";
goto error_common;
error_bridge:
ose << "No BRIDGE in template for Virtual Network id " << oid;
ose << "No BRIDGE in template for Virtual Network, id: ";
goto error_common;
error_update:
ose << "Can not update Virtual Network id " << oid;
ose << "Can not update Virtual Network, id: ";
goto error_common;
error_addr:
ose << "Network address is not defined nid: " << oid;
ose << "Network address is not defined, id: ";
goto error_leases;
error_null_leases:
ose << "Error getting Virtual Network leases nid: " << oid;
ose << "Error getting Virtual Network leases, id: ";
error_leases:
vn_drop(db);
error_common:
ose << oid << ".";
error_str = ose.str();
NebulaLog::log("VNM", Log::ERROR, ose);
return -1;