aws_csshx 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,7 @@
1
+ ### aws_csshx 0.1.5 2013-05-15
2
+
3
+ * Allow to SSH to multiple groups (Eric Lubow)
4
+
1
5
  ### aws_csshx 0.1.4 2012-05-21
2
6
 
3
7
  * Better error handling (Eric Lubow)
@@ -10,7 +10,10 @@ Gem::Specification.new do |s|
10
10
  s.email = ["eric@lubow.org"]
11
11
  s.homepage = ""
12
12
  s.summary = %q{csshx wrapper that interacts with your AWS account for group ssh sessions}
13
- s.description = %q{csshx wrapper that interacts with your AWS account for group ssh sessions}
13
+ s.description = %q{
14
+ csshx wrapper that interacts with your AWS account for group ssh sessions. You can even pass in multiple security groups
15
+ to access all hosts within those groups.
16
+ }
14
17
 
15
18
  s.add_dependency 'right_aws'
16
19
 
@@ -66,16 +66,24 @@ module AwsCsshx
66
66
 
67
67
  raise OptionsError, "Cannot continue without AWS security group (-g)" unless @options[:group]
68
68
 
69
- @server_list = aws_server_list_by_group @options[:group]
70
- aws_server_count = @server_list.count
69
+ @server_list = []
70
+ if @options[:group].respond_to?('each')
71
+ @options[:group].each {|grp| @server_list.push(aws_server_list_by_group grp)}
72
+ else
73
+ @server_list = aws_server_list_by_group @options[:group]
74
+ end
71
75
 
72
76
  # Add any additional servers from the command line to the pool
73
77
  add_servers_from_command_line if @options[:additional_servers]
74
78
 
79
+ # De-duplicateify the list
80
+ @server_list.flatten!.uniq!
81
+
82
+ aws_server_count = @server_list.count
75
83
  if has_servers? @server_list
76
84
  csshx_switches = create_csshx_switches
77
85
  `csshx #{[csshx_switches, @server_list].join(' ')}`
78
- puts "Opened connections to #{aws_server_count} servers in the '#{@options[:group]}' security group."
86
+ puts "Opened connections to #{aws_server_count} servers in the following security groups: #{@options[:group]}"
79
87
  puts "Opened connections to #{@options[:additional_servers].count} servers from command-line options." if @options[:additional_servers]
80
88
  else
81
89
  raise OptionsError, "No servers found in '#{@options[:group]}' group...bailing out!"
@@ -22,7 +22,7 @@ module AwsCsshx
22
22
  o.separator "AWS Options"
23
23
 
24
24
  options[:group] = 'default'
25
- o.on( '-g', '--group <group>', 'AWS security group name to use for the csshX sessions' ) do |group|
25
+ o.on( '-g', '--group group1,group2,group3', Array, 'AWS security group name to use for the csshX sessions (comma separated)' ) do |group|
26
26
  options[:group] = group
27
27
  end
28
28
 
@@ -1,3 +1,3 @@
1
1
  module AwsCsshx
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws_csshx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-05-21 00:00:00.000000000 Z
13
+ date: 2013-05-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: right_aws
@@ -28,7 +28,9 @@ dependencies:
28
28
  - - ! '>='
29
29
  - !ruby/object:Gem::Version
30
30
  version: '0'
31
- description: csshx wrapper that interacts with your AWS account for group ssh sessions
31
+ description: ! "\n csshx wrapper that interacts with your AWS account for group
32
+ ssh sessions. You can even pass in multiple security groups\n to access all hosts
33
+ within those groups.\n "
32
34
  email:
33
35
  - eric@lubow.org
34
36
  executables:
@@ -71,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
73
  version: '0'
72
74
  requirements: []
73
75
  rubyforge_project: aws_csshx
74
- rubygems_version: 1.8.18
76
+ rubygems_version: 1.8.24
75
77
  signing_key:
76
78
  specification_version: 3
77
79
  summary: csshx wrapper that interacts with your AWS account for group ssh sessions