mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-08 21:17:43 +03:00
Add migrator to 4.6.0. ACL rule was missing
This commit is contained in:
parent
fc9b3b0d1b
commit
cec4179036
@ -381,7 +381,7 @@ public:
|
||||
*/
|
||||
static string shared_db_version()
|
||||
{
|
||||
return "4.5.80";
|
||||
return "4.6.0";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1083,7 +1083,8 @@ ONEDB_SHARED_MIGRATOR_FILES="src/onedb/shared/2.0_to_2.9.80.rb \
|
||||
src/onedb/shared/4.3.85_to_4.3.90.rb \
|
||||
src/onedb/shared/4.3.90_to_4.4.0.rb \
|
||||
src/onedb/shared/4.4.0_to_4.4.1.rb \
|
||||
src/onedb/shared/4.4.1_to_4.5.80.rb"
|
||||
src/onedb/shared/4.4.1_to_4.5.80.rb\
|
||||
src/onedb/shared/4.5.80_to_4.6.0.rb"
|
||||
|
||||
ONEDB_LOCAL_MIGRATOR_FILES=""
|
||||
|
||||
|
@ -22,7 +22,7 @@ require 'set'
|
||||
require 'nokogiri'
|
||||
|
||||
module OneDBFsck
|
||||
VERSION = "4.5.80"
|
||||
VERSION = "4.6.0"
|
||||
LOCAL_VERSION = "4.5.80"
|
||||
|
||||
def check_db_version()
|
||||
|
@ -28,7 +28,7 @@ require 'opennebula'
|
||||
include OpenNebula
|
||||
|
||||
module OneDBImportSlave
|
||||
VERSION = "4.5.80"
|
||||
VERSION = "4.6.0"
|
||||
LOCAL_VERSION = "4.5.80"
|
||||
|
||||
def check_db_version(master_db_version, slave_db_version)
|
||||
|
42
src/onedb/shared/4.5.80_to_4.6.0.rb
Normal file
42
src/onedb/shared/4.5.80_to_4.6.0.rb
Normal file
@ -0,0 +1,42 @@
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2002-2014, OpenNebula Project (OpenNebula.org), C12G Labs #
|
||||
# #
|
||||
# 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. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
require 'nokogiri'
|
||||
|
||||
module Migrator
|
||||
def db_version
|
||||
"4.6.0"
|
||||
end
|
||||
|
||||
def one_version
|
||||
"OpenNebula 4.6.0"
|
||||
end
|
||||
|
||||
def up
|
||||
last_oid = -1
|
||||
|
||||
@db.fetch("SELECT last_oid FROM pool_control WHERE tablename='acl'") do |row|
|
||||
last_oid = row[:last_oid].to_i
|
||||
end
|
||||
|
||||
# * ZONE/* USE *
|
||||
@db.run "INSERT INTO acl VALUES(#{last_oid+1},17179869184,140754668224512,1,17179869184);"
|
||||
|
||||
@db.run "REPLACE INTO pool_control VALUES('acl', #{last_oid+1});"
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user