diff --git a/install.sh b/install.sh index fb6452dba2..4dcf332d88 100755 --- a/install.sh +++ b/install.sh @@ -817,6 +817,7 @@ ONEDB_MIGRATOR_FILES="src/onedb/2.0_to_2.9.80.rb \ src/onedb/3.0.0_to_3.1.0.rb \ src/onedb/3.1.0_to_3.1.80.rb \ src/onedb/3.1.80_to_3.2.0.rb \ + src/onedb/3.2.0_to_3.2.1.rb \ src/onedb/onedb.rb \ src/onedb/onedb_backend.rb" diff --git a/src/cloud/occi/lib/ui/public/js/plugins/storage.js b/src/cloud/occi/lib/ui/public/js/plugins/storage.js index f505615b1e..6e7b99d7fd 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/storage.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/storage.js @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- */ -/* Copyright 2002-2012, OpenNebula Project Leads (OCCI.org) */ +/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); you may */ /* not use this file except in compliance with the License. You may obtain */ diff --git a/src/onedb/3.2.0_to_3.2.1.rb b/src/onedb/3.2.0_to_3.2.1.rb new file mode 100644 index 0000000000..2ae7cca937 --- /dev/null +++ b/src/onedb/3.2.0_to_3.2.1.rb @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------- * +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# Licensed under the Apache License, Version 2.0 (the "License"); you may * +# not use this file except in compliance with the License. You may obtain * +# a copy of the License at * +# * +# http://www.apache.org/licenses/LICENSE-2.0 * +# * +# Unless required by applicable law or agreed to in writing, software * +# distributed under the License is distributed on an "AS IS" BASIS, * +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * +# See the License for the specific language governing permissions and * +# limitations under the License. * +# -------------------------------------------------------------------------- * + +module Migrator + def db_version + "3.2.1" + end + + def one_version + "OpenNebula 3.2.1" + end + + def up + return true + end +end diff --git a/src/pool/PoolSQL.cc b/src/pool/PoolSQL.cc index f763dd2b38..0d167e2d4f 100644 --- a/src/pool/PoolSQL.cc +++ b/src/pool/PoolSQL.cc @@ -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(); diff --git a/src/rm/RequestManagerChown.cc b/src/rm/RequestManagerChown.cc index e1563dfd83..4ecbf9ee48 100644 --- a/src/rm/RequestManagerChown.cc +++ b/src/rm/RequestManagerChown.cc @@ -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;