poolparty 1.5.0 → 1.6.0

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.yml CHANGED
@@ -2,4 +2,4 @@
2
2
  :patch: 0
3
3
  :major: 1
4
4
  :build:
5
- :minor: 5
5
+ :minor: 6
data/bin/cloud-run ADDED
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+ $:.unshift(File.dirname(__FILE__) + "/../lib")
3
+
4
+ require "poolparty"
5
+ require 'git-style-binary/command'
6
+
7
+ GitStyleBinary.command do
8
+ banner <<-EOS
9
+ Usage: #{$0} #{all_options_string}
10
+
11
+ Run a command on all running instances
12
+ EOS
13
+
14
+ opt :instance_id, "Run only on a specific instance", :type => String, :default => nil
15
+ opt :command, "Command to run", :type => String, :default => nil
16
+
17
+ short_desc "Run a command on all running instances"
18
+
19
+ run do |command|
20
+ puts "Running command #{command[:command]} on all nodes"
21
+ @loaded_clouds.each do |cld|
22
+
23
+ output = cld.nodes.map do |n|
24
+ n.ssh(command[:command])
25
+ end
26
+
27
+ p output
28
+
29
+ end
30
+ end
31
+ end
@@ -113,7 +113,7 @@ module CloudProviders
113
113
  def system_run(cmd, o={})
114
114
  opts = {:quiet => false, :sysread => 1024}.merge(o)
115
115
  buf = ""
116
- puts("Running command: #{cmd}")
116
+ # puts("Running command: #{cmd}")
117
117
  Open3.popen3(cmd) do |stdout, stdin, stderr|
118
118
  begin
119
119
  while (chunk = stdin.readpartial(opts[:sysread]))
@@ -217,7 +217,7 @@ module CloudProviders
217
217
  def wait_for_node(instance)
218
218
  reset!
219
219
  inst = all_nodes.detect {|n| n.instance_id == instance.instance_id }
220
- inst.running?
220
+ inst.running? if inst
221
221
  end
222
222
 
223
223
  def contract_by(num=1)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poolparty
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ari Lerner
@@ -28,6 +28,7 @@ executables:
28
28
  - cloud-list
29
29
  - cloud-reboot
30
30
  - cloud-rsync
31
+ - cloud-run
31
32
  - cloud-show
32
33
  - cloud-ssh
33
34
  - cloud-start
@@ -52,6 +53,7 @@ files:
52
53
  - bin/cloud-list
53
54
  - bin/cloud-reboot
54
55
  - bin/cloud-rsync
56
+ - bin/cloud-run
55
57
  - bin/cloud-show
56
58
  - bin/cloud-ssh
57
59
  - bin/cloud-start