Ugly fix for parameters. Make mount/umount work again.

This commit is contained in:
Glenn Y. Rolland 2015-09-21 08:21:42 +02:00
parent 6cc8f7afc1
commit 236e095d83
3 changed files with 11 additions and 8 deletions

View file

@ -71,14 +71,14 @@ module Qasim ; module Map
when /^\s*TYPE\s*=\s*(.*)\s*$/ then when /^\s*TYPE\s*=\s*(.*)\s*$/ then
params[:type] = $1 params[:type] = $1
when /^\s*REMOTE_USER\s*=\s*(.*)\s*$/ then when /^\s*REMOTE_USER\s*=\s*(.*)\s*$/ then
params[:user] = $1 params[:ssh_user] = $1
when /^\s*REMOTE_PORT\s*=\s*(.*)\s*$/ then 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 when /^\s*REMOTE_HOST\s*=\s*(.*)\s*$/ then
params[:host] = $1 params[:ssh_host] = $1
when /^\s*REMOTE_CYPHER\s*=\s*(.*)\s*$/ then when /^\s*REMOTE_CYPHER\s*=\s*(.*)\s*$/ then
if CYPHERS.map(&:to_s).include? $1 then if CYPHERS.map(&:to_s).include? $1 then
params[:cypher] = $1.to_sym params[:ssh_cypher] = $1.to_sym
end end
when /^\s*MAP\s*=\s*(.*)\s+(.*)\s*$/ then when /^\s*MAP\s*=\s*(.*)\s+(.*)\s*$/ then
params[:links] ||= {} params[:links] ||= {}

View file

@ -1,4 +1,5 @@
require 'fileutils' require 'fileutils'
require 'pp'
module Qasim ; module Map module Qasim ; module Map
end ; end end ; end
@ -16,8 +17,9 @@ class Qasim::Map::Generic
@filename = params[:filename] @filename = params[:filename]
params.delete :filename params.delete :filename
@name = File.basename @filename, '.map' @name = File.basename @filename, '.map'
@params = params
pp @params
end end

View file

@ -86,16 +86,17 @@ class Qasim::Map::Ssh < Qasim::Map::Generic
"-o","workaround=all", "-o","workaround=all",
"-o","cache_timeout=900", # 15 min cache for files "-o","cache_timeout=900", # 15 min cache for files
"-o","cache_stat_timeout=1800", # 30 min cache for directories "-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","attr_timeout=1800", # 30 min attr cache
"-o","entry_timeout=1800", # 30 min entry cache "-o","entry_timeout=1800", # 30 min entry cache
"-o","ServerAliveInterval=15", # prevent I/O hang "-o","ServerAliveInterval=15", # prevent I/O hang
"-o","ServerAliveCountMax=3", # prevent I/O hang "-o","ServerAliveCountMax=3", # prevent I/O hang
"-o","no_readahead", "-o","no_readahead",
#"-o","Ciphers=arcfour", # force cypher #"-o","Ciphers=arcfour", # force cypher
"-o","Port=%s" % @port, "-o","Port=%s" % @params[:ssh_port],
"%s@%s:%s" % [@user,@host,remotepath], "%s@%s:%s" % [@params[:ssh_user],@params[:ssh_host],remotepath],
localpath ] localpath ]
STDERR.puts cmd + ' ' + cmd_args.join(' ')
if block_given? then if block_given? then
yield name, cmd, cmd_args yield name, cmd, cmd_args
else else