diff --git a/include/RequestManager.h b/include/RequestManager.h index 9687853ce8..5e4b47fe45 100644 --- a/include/RequestManager.h +++ b/include/RequestManager.h @@ -237,16 +237,19 @@ private: oss << "[" << method << "]" << " Error trying to " << action << " " << object; - - if ( id != -1 ) + + switch(id) { - oss << " [" << id << "]."; + case -2: + break; + case -1: + oss << "Pool."; + break; + default: + oss << " [" << id << "]."; + break; } - else - { - oss << " Pool."; - } - + if ( rc != (int)NULL ) { oss << " Returned error code [" << rc << "]."; diff --git a/src/rm/RequestManagerAllocate.cc b/src/rm/RequestManagerAllocate.cc index 795ec0e7da..519dd32760 100644 --- a/src/rm/RequestManagerAllocate.cc +++ b/src/rm/RequestManagerAllocate.cc @@ -81,7 +81,7 @@ error_authenticate: goto error_common; error_allocate: - oss.str(action_error(method_name, "CREATE", "VM", -1, rc)); + oss.str(action_error(method_name, "CREATE", "VM", -2, rc)); goto error_common; error_common: diff --git a/src/rm/RequestManagerClusterAllocate.cc b/src/rm/RequestManagerClusterAllocate.cc index d369bcf9dc..be09bdf110 100644 --- a/src/rm/RequestManagerClusterAllocate.cc +++ b/src/rm/RequestManagerClusterAllocate.cc @@ -95,7 +95,7 @@ error_authorize: goto error_common; error_cluster_allocate: - oss.str(action_error(method_name, "CREATE", "CLUSTER", -1, rc)); + oss.str(action_error(method_name, "CREATE", "CLUSTER", -2, rc)); goto error_common; error_common: diff --git a/src/rm/RequestManagerHostAllocate.cc b/src/rm/RequestManagerHostAllocate.cc index eefabab437..e94296624c 100644 --- a/src/rm/RequestManagerHostAllocate.cc +++ b/src/rm/RequestManagerHostAllocate.cc @@ -105,7 +105,7 @@ error_authorize: goto error_common; error_host_allocate: - oss.str(action_error(method_name, "CREATE", "HOST", -1, rc)); + oss.str(action_error(method_name, "CREATE", "HOST", -2, rc)); goto error_common; error_common: diff --git a/src/rm/RequestManagerImageAllocate.cc b/src/rm/RequestManagerImageAllocate.cc index 74357cf73b..47315cacf1 100644 --- a/src/rm/RequestManagerImageAllocate.cc +++ b/src/rm/RequestManagerImageAllocate.cc @@ -82,7 +82,7 @@ error_authenticate: goto error_common; error_allocate: - oss.str(action_error(method_name, "CREATE", "IMAGE", NULL, rc)); + oss.str(action_error(method_name, "CREATE", "IMAGE", -2, rc)); goto error_common; error_common: diff --git a/src/rm/RequestManagerUserAllocate.cc b/src/rm/RequestManagerUserAllocate.cc index 6c41cfdd52..5f15ea56c6 100644 --- a/src/rm/RequestManagerUserAllocate.cc +++ b/src/rm/RequestManagerUserAllocate.cc @@ -118,7 +118,7 @@ error_duplicate: goto error_common; error_allocate: - oss.str(action_error(method_name, "CREATE", "USER", -1, rc)); + oss.str(action_error(method_name, "CREATE", "USER", -2, rc)); goto error_common; error_common: diff --git a/src/rm/RequestManagerVirtualNetworkAllocate.cc b/src/rm/RequestManagerVirtualNetworkAllocate.cc index f12199c847..ddc1e880d8 100644 --- a/src/rm/RequestManagerVirtualNetworkAllocate.cc +++ b/src/rm/RequestManagerVirtualNetworkAllocate.cc @@ -97,7 +97,7 @@ error_get_user: goto error_common; error_vn_allocate: - oss.str(action_error(method_name, "ALLOCATE", "NET", -1, rc)); + oss.str(action_error(method_name, "CREATE", "NET", -2, rc)); goto error_common; error_common: