gaptool-client 0.3.6 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -20,3 +20,4 @@ gem 'clamp'
20
20
  gem 'net-ssh'
21
21
  gem 'net-scp'
22
22
  gem 'gaptool-api', ">= 0.3.2"
23
+ gem 'builder'
data/Gemfile.lock CHANGED
@@ -1,16 +1,15 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activesupport (3.2.11)
5
- i18n (~> 0.6)
4
+ activesupport (3.2.13)
5
+ i18n (= 0.6.1)
6
6
  multi_json (~> 1.0)
7
- bourne (1.1.2)
8
- mocha (= 0.10.5)
9
- clamp (0.5.0)
10
- gaptool-api (0.3.2)
7
+ builder (3.2.0)
8
+ clamp (0.6.1)
9
+ gaptool-api (0.3.3)
11
10
  httparty
12
11
  git (1.2.5)
13
- httparty (0.10.2)
12
+ httparty (0.11.0)
14
13
  multi_json (~> 1.0)
15
14
  multi_xml (>= 0.5.2)
16
15
  i18n (0.6.1)
@@ -19,27 +18,23 @@ GEM
19
18
  git (>= 1.2.5)
20
19
  rake
21
20
  rdoc
22
- json (1.7.6)
23
- metaclass (0.0.1)
24
- mocha (0.10.5)
25
- metaclass (~> 0.0.1)
26
- multi_json (1.5.0)
27
- multi_xml (0.5.2)
28
- net-scp (1.0.4)
29
- net-ssh (>= 1.99.1)
30
- net-ssh (2.6.2)
21
+ json (1.8.0)
22
+ multi_json (1.7.3)
23
+ multi_xml (0.5.3)
24
+ net-scp (1.1.1)
25
+ net-ssh (>= 2.6.5)
26
+ net-ssh (2.6.7)
31
27
  peach (0.5.1)
32
28
  rainbow (1.1.4)
33
- rake (10.0.3)
34
- rdoc (3.12)
29
+ rake (10.0.4)
30
+ rdoc (4.0.1)
35
31
  json (~> 1.4)
36
- shoulda (3.3.2)
37
- shoulda-context (~> 1.0.1)
38
- shoulda-matchers (~> 1.4.1)
39
- shoulda-context (1.0.2)
40
- shoulda-matchers (1.4.2)
32
+ shoulda (3.5.0)
33
+ shoulda-context (~> 1.0, >= 1.0.1)
34
+ shoulda-matchers (>= 1.4.1, < 3.0)
35
+ shoulda-context (1.1.2)
36
+ shoulda-matchers (2.1.0)
41
37
  activesupport (>= 3.0.0)
42
- bourne (~> 1.1.2)
43
38
  simplecov (0.7.1)
44
39
  multi_json (~> 1.0)
45
40
  simplecov-html (~> 0.7.1)
@@ -49,6 +44,7 @@ PLATFORMS
49
44
  ruby
50
45
 
51
46
  DEPENDENCIES
47
+ builder
52
48
  bundler
53
49
  clamp
54
50
  gaptool-api (>= 0.3.2)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.6
1
+ 0.4.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gaptool-client"
8
- s.version = "0.3.6"
8
+ s.version = "0.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Matt Bailey"]
12
- s.date = "2013-02-07"
12
+ s.date = "2013-05-16"
13
13
  s.description = "client for gaptool-server"
14
14
  s.email = "m@mdb.io"
15
15
  s.executables = ["gt"]
@@ -48,6 +48,7 @@ Gem::Specification.new do |s|
48
48
  s.add_runtime_dependency(%q<net-ssh>, [">= 0"])
49
49
  s.add_runtime_dependency(%q<net-scp>, [">= 0"])
50
50
  s.add_runtime_dependency(%q<gaptool-api>, [">= 0.3.2"])
51
+ s.add_runtime_dependency(%q<builder>, [">= 0"])
51
52
  s.add_development_dependency(%q<shoulda>, [">= 0"])
52
53
  s.add_development_dependency(%q<rdoc>, [">= 0"])
53
54
  s.add_development_dependency(%q<bundler>, [">= 0"])
@@ -61,6 +62,7 @@ Gem::Specification.new do |s|
61
62
  s.add_dependency(%q<net-ssh>, [">= 0"])
62
63
  s.add_dependency(%q<net-scp>, [">= 0"])
63
64
  s.add_dependency(%q<gaptool-api>, [">= 0.3.2"])
65
+ s.add_dependency(%q<builder>, [">= 0"])
64
66
  s.add_dependency(%q<shoulda>, [">= 0"])
65
67
  s.add_dependency(%q<rdoc>, [">= 0"])
66
68
  s.add_dependency(%q<bundler>, [">= 0"])
@@ -75,6 +77,7 @@ Gem::Specification.new do |s|
75
77
  s.add_dependency(%q<net-ssh>, [">= 0"])
76
78
  s.add_dependency(%q<net-scp>, [">= 0"])
77
79
  s.add_dependency(%q<gaptool-api>, [">= 0.3.2"])
80
+ s.add_dependency(%q<builder>, [">= 0"])
78
81
  s.add_dependency(%q<shoulda>, [">= 0"])
79
82
  s.add_dependency(%q<rdoc>, [">= 0"])
80
83
  s.add_dependency(%q<bundler>, [">= 0"])
@@ -40,16 +40,48 @@ def sshcmd(node, commands)
40
40
  :keys_only => true,
41
41
  :paranoid => false
42
42
  ) do |ssh|
43
+ stdout_data = ""
44
+ stderr_data = ""
45
+ exit_code = nil
46
+ exit_signal = nil
43
47
  commands.each do |command|
44
- command.color(:cyan)
45
- ssh.exec! command do
46
- |ch, stream, line|
47
- puts "#{node['role'].color(:yellow)}:#{node['environment'].color(:yellow)}:#{node['instance'].color(:yellow)}> #{line}"
48
+ ssh.open_channel do |channel|
49
+ channel.exec(command) do |ch, success|
50
+ unless success
51
+ abort "FAILED: couldn't execute command (ssh.channel.exec)"
52
+ end
53
+ channel.on_data do |ch,data|
54
+ puts "#{node['role'].color(:yellow)}:#{node['environment'].color(:yellow)}:#{node['instance'].color(:yellow)}> #{data}"
55
+ end
56
+
57
+ channel.on_extended_data do |ch,type,data|
58
+ puts "#{node['role'].color(:yellow)}:#{node['environment'].color(:yellow)}:#{node['instance'].color(:red)}> #{data}"
59
+ end
60
+
61
+ channel.on_request("exit-status") do |ch,data|
62
+ exit_code = data.read_long
63
+ if exit_code != 0
64
+ exit exit_code
65
+ end
66
+ end
67
+
68
+ channel.on_request("exit-signal") do |ch, data|
69
+ exit_signal = data.read_string
70
+ end
71
+ end
48
72
  end
49
73
  end
74
+ # ssh.loop
75
+ # [stdout_data, stderr_data, exit_code, exit_signal]
50
76
  end
51
77
  end
52
78
 
79
+ #def sshcmd(node, commands)
80
+ # commands.each do |command|
81
+ # ssh_exec!(node, command)
82
+ # end
83
+ #end
84
+
53
85
  module Gaptool
54
86
  class InitCommand < Clamp::Command
55
87
  option ["-r", "--role"], "ROLE", "Resource name to initilize", :required => true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gaptool-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-07 00:00:00.000000000 Z
12
+ date: 2013-05-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -123,6 +123,22 @@ dependencies:
123
123
  - - ! '>='
124
124
  - !ruby/object:Gem::Version
125
125
  version: 0.3.2
126
+ - !ruby/object:Gem::Dependency
127
+ name: builder
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :runtime
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
126
142
  - !ruby/object:Gem::Dependency
127
143
  name: shoulda
128
144
  requirement: !ruby/object:Gem::Requirement
@@ -239,7 +255,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
239
255
  version: '0'
240
256
  segments:
241
257
  - 0
242
- hash: -1782639922451775426
258
+ hash: 1836818138274775584
243
259
  required_rubygems_version: !ruby/object:Gem::Requirement
244
260
  none: false
245
261
  requirements: