gaptool-client 0.6.13 → 0.6.14

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/gaptool-client.rb +14 -9
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca27da90fc36a000640f74677dbf15ab1d614c5c
4
- data.tar.gz: ac94919d2e88b4d0c59a8f715437e07398e8b198
3
+ metadata.gz: 8ed7aec78e38e775659a5c972701836ba26bd0bf
4
+ data.tar.gz: 81242d83526297e991438283510aa26398f7d982
5
5
  SHA512:
6
- metadata.gz: 1787d004c74ce095af217bb2103a178f71d882f14aa0abecaea09ce108cfca06b98a4a12a84debb01b00c6df610a162e7c8b11d2d5a4cad5fa56f6e73c1e4d2e
7
- data.tar.gz: 877ff78d98d121dd6b2248ba4edbebd05e4d72b0011bc76bec20e54e4d1ef005dc4a78f5d9fe8b5d1a62a8b1ebbc35e3b542289c006ba0084027079c671d2563
6
+ metadata.gz: fb71d1eb887b8efe99d8e8ecdfb0a4b61976b81a6168f07bdda6eed75113ee3fd212276fcd3b6a66fecc93f120db9b5b6ae34c2517763352f1f501dfe8d88ae6
7
+ data.tar.gz: 61978da8b616780f2f94e6ece704adc5d3726aa59462a6925e5dd0d5e7098ce159da73ed35712a7c8006e8a238d4e1166670cb44f137d07a6e1071b80ab6d4fb
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.13
1
+ 0.6.14
@@ -40,32 +40,30 @@ def sshcmd(node, commands)
40
40
  :keys_only => true,
41
41
  :paranoid => false
42
42
  ) do |ssh|
43
- stdout_data = ""
44
- stderr_data = ""
45
43
  exit_code = nil
46
44
  exit_signal = nil
47
45
  commands.each do |command|
48
46
  ssh.open_channel do |channel|
49
- channel.exec(command) do |ch, success|
47
+ channel.exec(command) do |chx, success|
50
48
  unless success
51
49
  abort "FAILED: couldn't execute command (ssh.channel.exec)"
52
50
  end
53
- channel.on_data do |ch,data|
51
+ channel.on_data do |chd,data|
54
52
  puts "#{Rainbow(node['role']).yellow}:#{Rainbow(node['environment']).yellow}:#{Rainbow(node['instance']).yellow}> #{data}"
55
53
  end
56
54
 
57
- channel.on_extended_data do |ch,type,data|
55
+ channel.on_extended_data do |che,type,data|
58
56
  puts "#{Rainbow(node['role']).yellow}:#{Rainbow(node['environment']).yellow}:#{Rainbow(node['instance']).red}> #{data}"
59
57
  end
60
58
 
61
- channel.on_request("exit-status") do |ch,data|
59
+ channel.on_request("exit-status") do |chs,data|
62
60
  exit_code = data.read_long
63
61
  if exit_code != 0
64
62
  exit exit_code
65
63
  end
66
64
  end
67
65
 
68
- channel.on_request("exit-signal") do |ch, data|
66
+ channel.on_request("exit-signal") do |chg, data|
69
67
  exit_signal = data.read_string
70
68
  end
71
69
  end
@@ -247,17 +245,24 @@ module Gaptool
247
245
  nodes = $api.getenvroles(role, environment)
248
246
  end
249
247
  nodes.peach do |node|
248
+ if node['chef_runlist'].nil?
249
+ runlist = ['recipe[main]']
250
+ elsif node['chef_runlist'].is_a? Array
251
+ runlist = node['chef_runlist']
252
+ else
253
+ runlist = eval(node['chef_runlist'])
254
+ end
250
255
  json = {
251
256
  'this_server' => "#{role}-#{environment}-#{node['instance']}",
252
257
  'role' => role,
253
258
  'environment' => environment,
254
259
  'app_user' => node['appuser'],
255
- 'run_list' => node['chef_runlist'].nil? ? ['recipe[main]'] : eval(node['chef_runlist']),
260
+ 'run_list' => runlist,
256
261
  'hostname' => node['hostname'],
257
262
  'instance' => node['instance'],
258
263
  'zone' => node['zone'],
259
264
  'itype' => node['itype'],
260
- 'apps' => eval(node['apps']),
265
+ 'apps' => eval(node['apps'] || '[]'),
261
266
  }.merge(attrs)
262
267
  git="git fetch --all; git reset --hard origin/`git rev-parse --abbrev-ref HEAD`"
263
268
 
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.6.13
4
+ version: 0.6.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Laurita
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-10-29 00:00:00.000000000 Z
13
+ date: 2014-12-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
226
  version: '0'
227
227
  requirements: []
228
228
  rubyforge_project: gaptool-client
229
- rubygems_version: 2.2.2
229
+ rubygems_version: 2.4.3
230
230
  signing_key:
231
231
  specification_version: 4
232
232
  summary: client for gaptool-server