cloudkick 0.2.1 → 0.2.2

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
data/cloudkick.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cloudkick}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Cloudkick"]
@@ -3,18 +3,32 @@ require 'tempfile'
3
3
  module Cloudkick::Command
4
4
  class Pssh < Base
5
5
  def index
6
- unless args.size == 3
7
- raise CommandFailed, 'usage: cloudkick pssh <username> <output> <command>'
6
+ unless args.size == 6 or args.size == 8
7
+ raise CommandFailed, 'usage: cloudkick pssh --query <query> ' \
8
+ '--username <username> ' \
9
+ '--output <output> ' \
10
+ '--command <command>'
8
11
  end
9
12
 
13
+ query = extract_option('--query')
14
+ username = extract_option('--username')
15
+ output = extract_option('--output')
16
+ command = extract_option('--command')
17
+
10
18
  file = Tempfile.new('ck')
11
19
 
12
- client.get('nodes').each do |node|
13
- file.puts node.ipaddress
20
+ if query
21
+ client.get('nodes', query).each do |node|
22
+ file.puts node.ipaddress
23
+ end
24
+ else
25
+ client.get('nodes').each do |node|
26
+ file.puts node.ipaddress
27
+ end
14
28
  end
15
29
 
16
30
  file.flush
17
- exec("pssh -h #{file.path} -l #{@args[0]} -o #{args[1]} #{args[2]}")
31
+ exec("pssh -h #{file.path} -l #{username} -o #{output} #{command}")
18
32
  file.close
19
33
  end
20
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudkick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cloudkick