1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

M #-: Fix onezone serversync (#992)

This commit is contained in:
Pavel Czerný 2021-03-17 19:48:44 +01:00 committed by GitHub
parent e829fde147
commit 50b526630e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 12 deletions

View File

@ -101,8 +101,8 @@ class Replicator
# Process files and folders
#
# @param sync_db [Boolean] True to sync database
def process_files(sync_db)
# @param sync_database [Boolean] True to sync database
def process_files(sync_database)
# Files to be copied
copy_onedconf
@ -118,7 +118,7 @@ class Replicator
restart_services
# Sync database
sync_db
sync_db if sync_database
end
private
@ -127,14 +127,14 @@ class Replicator
#
# @param configs [Object] Configuration
def fetch_db_config(configs)
configs.store(:backend, configs[:raw]['/TEMPLATE/DB/BACKEND'])
configs.store(:backend, configs[:raw]['/OPENNEBULA_CONFIGURATION/DB/BACKEND'])
if configs[:backend] == 'mysql'
configs.store(:server, configs[:raw]['/TEMPLATE/DB/SERVER'])
configs.store(:user, configs[:raw]['/TEMPLATE/DB/USER'])
configs.store(:password, configs[:raw]['/TEMPLATE/DB/PASSWD'])
configs.store(:dbname, configs[:raw]['/TEMPLATE/DB/DB_NAME'])
configs.store(:port, configs[:raw]['/TEMPLATE/DB/PORT'])
configs.store(:server, configs[:raw]['/OPENNEBULA_CONFIGURATION/DB/SERVER'])
configs.store(:user, configs[:raw]['/OPENNEBULA_CONFIGURATION/DB/USER'])
configs.store(:password, configs[:raw]['/OPENNEBULA_CONFIGURATION/DB/PASSWD'])
configs.store(:dbname, configs[:raw]['/OPENNEBULA_CONFIGURATION/DB/DB_NAME'])
configs.store(:port, configs[:raw]['/OPENNEBULA_CONFIGURATION/DB/PORT'])
configs[:port] = '3306' if configs[:port] == '0'
else
STDERR.puts 'No mysql backend configuration found'
@ -147,9 +147,9 @@ class Replicator
# @param configs [Object] Configuration
def fetch_fed_config(configs)
configs.store(:server_id,
configs[:raw]['/TEMPLATE/FEDERATION/SERVER_ID'])
configs[:raw]['/OPENNEBULA_CONFIGURATION/FEDERATION/SERVER_ID'])
configs.store(:zone_id,
configs[:raw]['/TEMPLATE/FEDERATION/ZONE_ID'])
configs[:raw]['/OPENNEBULA_CONFIGURATION/FEDERATION/ZONE_ID'])
end
# Replaces a file with the version located on a remote server

View File

@ -57,7 +57,7 @@ CommandParser::CmdParser.new(ARGV) do
}
DATABASE = {
:name => 'database',
:name => 'db',
:large => '--db',
:description => 'Also sync database'
}