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

bug #1087: More work on the cache

(cherry picked from commit f05942f6e4)
This commit is contained in:
Ruben S. Montero 2012-01-26 11:28:07 +01:00 committed by Carlos Martín
parent 7e92bd8dd8
commit 404b34c98a
2 changed files with 15 additions and 4 deletions

View File

@ -356,7 +356,11 @@ void PoolSQL::update_cache_index(string& old_name,
if ( index != name_pool.end() )
{
name_pool.erase(old_key);
name_pool.insert(make_pair(new_key, index->second));
if ( name_pool.find(new_key) == name_pool.end())
{
name_pool.insert(make_pair(new_key, index->second));
}
}
unlock();

View File

@ -69,6 +69,9 @@ void RequestManagerChown::request_execute(xmlrpc_c::paramList const& paramList,
PoolObjectSQL * object;
string obj_name;
int old_uid;
// ------------- Check new user and group id's ---------------------
if ( noid > -1 )
@ -138,12 +141,11 @@ void RequestManagerChown::request_execute(xmlrpc_c::paramList const& paramList,
if ( noid != -1 )
{
string obj_name = object->get_name();
int old_uid = object->get_uid();
obj_name = object->get_name();
old_uid = object->get_uid();
object->set_user(noid,nuname);
pool->update_cache_index(obj_name, old_uid, obj_name, noid);
}
if ( ngid != -1 )
@ -155,6 +157,11 @@ void RequestManagerChown::request_execute(xmlrpc_c::paramList const& paramList,
object->unlock();
if ( noid != -1 )
{
pool->update_cache_index(obj_name, old_uid, obj_name, noid);
}
success_response(oid, att);
return;