diff --git a/include/RequestManager.h b/include/RequestManager.h index 6b118cc454..9687853ce8 100644 --- a/include/RequestManager.h +++ b/include/RequestManager.h @@ -184,7 +184,7 @@ private: << " to perform " << action << " on " << object; - if ( id != (int)NULL ) + if ( id != -1 ) { oss << " [" << id << "]."; } @@ -215,7 +215,7 @@ private: oss << "[" << method << "]" << " Error getting " << object; - if ( id != (int)NULL ) + if ( id != -1 ) { oss << " [" << id << "]."; } @@ -238,18 +238,20 @@ private: oss << "[" << method << "]" << " Error trying to " << action << " " << object; - if ( id != (int)NULL ) + if ( id != -1 ) { oss << " [" << id << "]."; } + else + { + oss << " Pool."; + } if ( rc != (int)NULL ) { - oss << " .Returned error code [" << rc << "]."; + oss << " Returned error code [" << rc << "]."; } - NebulaLog::log("RM",Log::ERROR,oss); - return oss.str(); } diff --git a/src/rm/RequestManagerAllocate.cc b/src/rm/RequestManagerAllocate.cc index f91ffde242..795ec0e7da 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", NULL, rc)); + oss.str(action_error(method_name, "CREATE", "VM", -1, rc)); goto error_common; error_common: diff --git a/src/rm/RequestManagerClusterAllocate.cc b/src/rm/RequestManagerClusterAllocate.cc index 72e154e6e5..d369bcf9dc 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", NULL, rc)); + oss.str(action_error(method_name, "CREATE", "CLUSTER", -1, rc)); goto error_common; error_common: diff --git a/src/rm/RequestManagerClusterPoolInfo.cc b/src/rm/RequestManagerClusterPoolInfo.cc index 46d6a28d52..7974fca010 100755 --- a/src/rm/RequestManagerClusterPoolInfo.cc +++ b/src/rm/RequestManagerClusterPoolInfo.cc @@ -76,7 +76,7 @@ error_authenticate: goto error_common; error_dump: - oss.str(get_error(method_name, "CLUSTER", NULL)); + oss.str(get_error(method_name, "CLUSTER", -1)); goto error_common; error_common: diff --git a/src/rm/RequestManagerHostAllocate.cc b/src/rm/RequestManagerHostAllocate.cc index 5fcbcc91c2..eefabab437 100644 --- a/src/rm/RequestManagerHostAllocate.cc +++ b/src/rm/RequestManagerHostAllocate.cc @@ -101,11 +101,11 @@ error_authenticate: goto error_common; error_authorize: - oss.str(authorization_error(method_name, "CREATE", "HOST", rc, NULL)); + oss.str(authorization_error(method_name, "CREATE", "HOST", rc, -1)); goto error_common; error_host_allocate: - oss.str(action_error(method_name, "CREATE", "HOST", NULL, rc)); + oss.str(action_error(method_name, "CREATE", "HOST", -1, rc)); goto error_common; error_common: diff --git a/src/rm/RequestManagerImageDelete.cc b/src/rm/RequestManagerImageDelete.cc index 6d7813063c..20875bf5f7 100644 --- a/src/rm/RequestManagerImageDelete.cc +++ b/src/rm/RequestManagerImageDelete.cc @@ -133,8 +133,8 @@ error_authorize: goto error_common; error_delete: - oss.str(action_error(method_name, "DELETE", "IMAGE", iid, rc)); - oss << " VMs might be running on it."; + oss << action_error(method_name, "DELETE", "IMAGE", iid, rc) + << ". Reason: VMs might be running on it."; image->unlock(); goto error_common; diff --git a/src/rm/RequestManagerUserAllocate.cc b/src/rm/RequestManagerUserAllocate.cc index 7fa13d4aad..6c41cfdd52 100644 --- a/src/rm/RequestManagerUserAllocate.cc +++ b/src/rm/RequestManagerUserAllocate.cc @@ -109,16 +109,16 @@ error_authenticate: goto error_common; error_authorize: - oss.str(authorization_error(method_name, "CREATE", "USER", rc, NULL)); + oss.str(authorization_error(method_name, "CREATE", "USER", rc, -1)); goto error_common; error_duplicate: - oss << action_error(method_name, "CREATE", "USER", NULL, NULL) + oss << action_error(method_name, "CREATE", "USER", -1, NULL) << ". Reason: Existing user, cannot duplicate."; goto error_common; error_allocate: - oss.str(action_error(method_name, "CREATE", "USER", NULL, rc)); + oss.str(action_error(method_name, "CREATE", "USER", -1, rc)); goto error_common; error_common: diff --git a/src/rm/RequestManagerVirtualNetworkAllocate.cc b/src/rm/RequestManagerVirtualNetworkAllocate.cc index 1be91fdb19..f12199c847 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", NULL, rc)); + oss.str(action_error(method_name, "ALLOCATE", "NET", -1, rc)); goto error_common; error_common: diff --git a/src/rm/RequestManagerVirtualNetworkPublish.cc b/src/rm/RequestManagerVirtualNetworkPublish.cc index 4ec9c3d414..c8d0befb6e 100644 --- a/src/rm/RequestManagerVirtualNetworkPublish.cc +++ b/src/rm/RequestManagerVirtualNetworkPublish.cc @@ -33,7 +33,6 @@ void RequestManager::VirtualNetworkPublish::execute( int nid; bool publish_flag; int uid; - int rc; VirtualNetwork * vn;