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:
parent
e829fde147
commit
50b526630e
@ -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
|
||||
|
@ -57,7 +57,7 @@ CommandParser::CmdParser.new(ARGV) do
|
||||
}
|
||||
|
||||
DATABASE = {
|
||||
:name => 'database',
|
||||
:name => 'db',
|
||||
:large => '--db',
|
||||
:description => 'Also sync database'
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user