From 236e095d83724c5988b62160c6c344c9c7d57210 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Mon, 21 Sep 2015 08:21:42 +0200 Subject: [PATCH] Ugly fix for parameters. Make mount/umount work again. --- lib/qasim/map.rb | 8 ++++---- lib/qasim/map/generic.rb | 4 +++- lib/qasim/map/ssh.rb | 7 ++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/qasim/map.rb b/lib/qasim/map.rb index ef7dcc9..6678aa5 100644 --- a/lib/qasim/map.rb +++ b/lib/qasim/map.rb @@ -71,14 +71,14 @@ module Qasim ; module Map when /^\s*TYPE\s*=\s*(.*)\s*$/ then params[:type] = $1 when /^\s*REMOTE_USER\s*=\s*(.*)\s*$/ then - params[:user] = $1 + params[:ssh_user] = $1 when /^\s*REMOTE_PORT\s*=\s*(.*)\s*$/ then - params[:port] = $1.to_i + params[:ssh_port] = $1.to_i when /^\s*REMOTE_HOST\s*=\s*(.*)\s*$/ then - params[:host] = $1 + params[:ssh_host] = $1 when /^\s*REMOTE_CYPHER\s*=\s*(.*)\s*$/ then if CYPHERS.map(&:to_s).include? $1 then - params[:cypher] = $1.to_sym + params[:ssh_cypher] = $1.to_sym end when /^\s*MAP\s*=\s*(.*)\s+(.*)\s*$/ then params[:links] ||= {} diff --git a/lib/qasim/map/generic.rb b/lib/qasim/map/generic.rb index 166bcb8..c169a5a 100644 --- a/lib/qasim/map/generic.rb +++ b/lib/qasim/map/generic.rb @@ -1,4 +1,5 @@ require 'fileutils' +require 'pp' module Qasim ; module Map end ; end @@ -16,8 +17,9 @@ class Qasim::Map::Generic @filename = params[:filename] params.delete :filename - @name = File.basename @filename, '.map' + @params = params + pp @params end diff --git a/lib/qasim/map/ssh.rb b/lib/qasim/map/ssh.rb index 760d19f..78aebc7 100644 --- a/lib/qasim/map/ssh.rb +++ b/lib/qasim/map/ssh.rb @@ -86,16 +86,17 @@ class Qasim::Map::Ssh < Qasim::Map::Generic "-o","workaround=all", "-o","cache_timeout=900", # 15 min cache for files "-o","cache_stat_timeout=1800", # 30 min cache for directories - "-o","cache_link_timout=1800", # 30 min cache for links + "-o","cache_link_timeout=1800", # 30 min cache for links "-o","attr_timeout=1800", # 30 min attr cache "-o","entry_timeout=1800", # 30 min entry cache "-o","ServerAliveInterval=15", # prevent I/O hang "-o","ServerAliveCountMax=3", # prevent I/O hang "-o","no_readahead", #"-o","Ciphers=arcfour", # force cypher - "-o","Port=%s" % @port, - "%s@%s:%s" % [@user,@host,remotepath], + "-o","Port=%s" % @params[:ssh_port], + "%s@%s:%s" % [@params[:ssh_user],@params[:ssh_host],remotepath], localpath ] + STDERR.puts cmd + ' ' + cmd_args.join(' ') if block_given? then yield name, cmd, cmd_args else