i2cssh 1.5.2 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/i2cssh +7 -16
- data/i2cssh.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.5.
|
1
|
+
1.5.3
|
data/bin/i2cssh
CHANGED
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
|
7
7
|
@config_file = File.expand_path "~/.i2csshrc"
|
8
8
|
|
9
|
-
@i2_options, ssh_options, @servers, @clusters, @ssh_environment = {}, [], [], {}, {}
|
9
|
+
@i2_options, ssh_options, @servers, @clusters, @ssh_environment, opts_from_cmdline = {}, [], [], {}, {}, {}
|
10
10
|
|
11
11
|
def get_hosts(c)
|
12
12
|
if c =~ /(.+)@(.+)/ then
|
@@ -19,13 +19,11 @@ def get_hosts(c)
|
|
19
19
|
if cluster
|
20
20
|
set_options(cluster, login_from_cli)
|
21
21
|
|
22
|
-
cluster_hosts = cluster["hosts"]
|
23
|
-
|
24
22
|
if @i2_options[:login_override] then
|
25
|
-
|
23
|
+
@servers += cluster["hosts"].map{|h| "#{@i2_options[:login_override]}@#{h}"}
|
24
|
+
else
|
25
|
+
@servers += cluster["hosts"]
|
26
26
|
end
|
27
|
-
|
28
|
-
@servers += cluster_hosts
|
29
27
|
else
|
30
28
|
puts "ERROR: unknown cluster #{c}. Check your #{@config_file}"
|
31
29
|
exit 1
|
@@ -33,16 +31,11 @@ def get_hosts(c)
|
|
33
31
|
end
|
34
32
|
|
35
33
|
def set_options(config_hash, login_override=nil)
|
36
|
-
|
37
|
-
@i2_options[
|
38
|
-
else
|
39
|
-
@i2_options[:login_override] = config_hash["login"].nil? ? @i2_options[:login_override] : config_hash["login"]
|
34
|
+
[:broadcast, :profile, :rank, :iterm2, :login_override].each do |p|
|
35
|
+
@i2_options[p] = config_hash[p.to_s].nil? ? @i2_options[p] : config_hash[p.to_s]
|
40
36
|
end
|
41
37
|
|
42
|
-
@i2_options[:
|
43
|
-
@i2_options[:profile] = config_hash["profile"].nil? ? @i2_options[:profile] : config_hash["profile"]
|
44
|
-
@i2_options[:rank] = config_hash["rank"].nil? ? @i2_options[:rank] : config_hash["rank"]
|
45
|
-
@i2_options[:iterm2] = config_hash["iterm2"].nil? ? @i2_options[:iterm2] : config_hash["iterm2"]
|
38
|
+
@i2_options[:login_override] = login_override if login_override
|
46
39
|
|
47
40
|
@ssh_environment.merge!(config_hash["environment"].inject({}){|m, v| m.merge(v)}) if config_hash["environment"]
|
48
41
|
end
|
@@ -61,8 +54,6 @@ if File.exists?(@config_file)
|
|
61
54
|
|
62
55
|
end
|
63
56
|
|
64
|
-
opts_from_cmdline = {}
|
65
|
-
|
66
57
|
optparse = OptionParser.new do |opts|
|
67
58
|
opts.banner = "Usage: #{File.basename(__FILE__)} [options] [(username@host [username@host] | username@cluster)]"
|
68
59
|
|
data/i2cssh.gemspec
CHANGED
metadata
CHANGED