1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-23 17:33:56 +03:00

Feature #4305: Remove --force option

(cherry picked from commit 1b41d5ee20)
This commit is contained in:
Jaime Melis 2016-01-22 10:27:33 +01:00
parent 37624fcf96
commit c489e193dd
2 changed files with 12 additions and 14 deletions

View File

@ -363,7 +363,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
Migrates a SQLite OpenNebula Database to MySQL
EOT
command :sqlite2mysql , sqlite2mysql_desc, :options=>[BACKUP, FORCE] do
command :sqlite2mysql , sqlite2mysql_desc, :options=>[BACKUP] do
begin
options[:backend] = :sqlite
sqlite = OneDB.new(options)

View File

@ -527,21 +527,19 @@ is preserved.
sqlite_v = sqlite.backend.read_db_version
mysql_v = @backend.read_db_version
if !options[:force]
match = true
match = false if sqlite_v[:version] != mysql_v[:version]
match = false if sqlite_v[:local_version] != mysql_v[:local_version]
match = true
match = false if sqlite_v[:version] != mysql_v[:version]
match = false if sqlite_v[:local_version] != mysql_v[:local_version]
if !match
err_msg = "SQLite version: #{sqlite_v[:version]}\n"
err_msg << "SQLite local version: #{sqlite_v[:local_version]}\n"
err_msg << "MySQL version: #{mysql_v[:version]}\n"
err_msg << "MySQL local version: #{mysql_v[:local_version]}\n"
err_msg << "The MySQL and SQLite versions do not match. Please run "
err_msg << "'onedb -i' in order to bootstrap a blank OpenNebula DB."
if !match
err_msg = "SQLite version: #{sqlite_v[:version]}\n"
err_msg << "SQLite local version: #{sqlite_v[:local_version]}\n"
err_msg << "MySQL version: #{mysql_v[:version]}\n"
err_msg << "MySQL local version: #{mysql_v[:local_version]}\n"
err_msg << "The MySQL and SQLite versions do not match. Please run "
err_msg << "'onedb -i' in order to bootstrap a blank OpenNebula DB."
raise err_msg
end
raise err_msg
end
backup(options[:backup], options)