lib/fulmar/infrastructure/service/database/database_service.rb in fulmar-1.7.2 vs lib/fulmar/infrastructure/service/database/database_service.rb in fulmar-1.7.3

- old
+ new

@@ -55,11 +55,11 @@ def local? @config[:hostname] == 'localhost' end def tunnel - @tunnel ||= Fulmar::Infrastructure::Service::TunnelService.new(@config[:hostname], @config[:maria][:port], @config[:maria][:hostname]) + @tunnel ||= Fulmar::Infrastructure::Service::TunnelService.new(@config.ssh_user_and_host, @config[:maria][:port], @config[:maria][:hostname]) end # shortcut for DatabaseService.client.query def query(*arguments) @client.query(arguments) @@ -89,11 +89,11 @@ end def download_dump(filename = backup_filename) local_path = filename[0, 1] == '/' ? filename : @config[:local_path] + '/' + filename remote_path = dump - copy = system("scp -q #{@config[:hostname]}:#{remote_path} #{local_path}") + copy = system("scp -q #{@config.ssh_user_and_host}:#{remote_path} #{local_path}") @shell.run "rm -f \"#{remote_path}\"" # delete temporary file if copy local_path else '' @@ -141,10 +141,10 @@ "#{@config[:maria][:database]}_#{Time.now.strftime('%Y-%m-%dT%H%M%S')}.sql" end def initialize_shell path = local? ? @config[:local_path] : @config[:remote_path] - @shell = Fulmar::Infrastructure::Service::ShellService.new(path, @config.ssh_user_and_host) + @shell = Fulmar::Infrastructure::Service::ShellService.new(path , @config.ssh_user_and_host) @shell.debug = true if @config[:debug] @shell.strict = true end # Compiles a mysql config hash from valid options of the fulmar config