rundock 0.4.8 → 0.4.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ca8602714ab2dca12d312ddae3619c2e2632d29
4
- data.tar.gz: 636b26551c99bb514b603f908a24778f1b2c1df4
3
+ metadata.gz: d57db6da4ef09d2b72d4100d7a0fefb1404bb06a
4
+ data.tar.gz: 0d778d72fffd50b046d32d86300d2847de359b3a
5
5
  SHA512:
6
- metadata.gz: 32559507e9f787ae08b05de133926e52b37d361d53391b9578068a6a1090228117a5ffc2d675c63fdafb13cb728d40ab0dc0cb26a929fa7032ed5b6fa0b31191
7
- data.tar.gz: 8c3be830faa2de8131a1109091d59ada52966045e916413a57bd92953741ffda92324f5c4323e157da41c7c7b9d1b274a7f03becb553eb0750765c1ba2382084
6
+ metadata.gz: 09f7c9a551f014b35ed6ae5dc03279694805a2a4b9745f9db66560b362d7a4ede30aedd1c8bfb44b52c822c4a138fe719157fe7ec9171f2d0023b7e3e45f7772
7
+ data.tar.gz: 65a57189d24d4da66da1652d0ee2ccd3b26b85d0f52bd6c05379cb37abfbd3fcfa4f82a9b23453d04d1a218d2c0ee6ba9c32fe92192447e64087552921c649c1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v0.4.9
2
+
3
+ Update
4
+
5
+ - Change the hook callback to include the operation info
6
+
1
7
  ## v0.4.2
2
8
 
3
9
  Update
@@ -11,7 +11,7 @@ module Rundock
11
11
  @contents = contents
12
12
  end
13
13
 
14
- def hook(log_buffer = [], node_info = {})
14
+ def hook(node_attributes = [], log_buffer = [])
15
15
  raise HookNotImplementedError
16
16
  end
17
17
  end
data/lib/rundock/node.rb CHANGED
@@ -24,11 +24,11 @@ module Rundock
24
24
  Logger.debug("run node: #{@name}")
25
25
  Logger.warn("no operation running: #{@name}") if @operations.blank?
26
26
 
27
- nodeinfo = nil
27
+ node_attributes = []
28
28
 
29
29
  @operations.each do |ope|
30
30
  Logger.debug("run operation: #{ope.class}")
31
- nodeinfo = ope.attributes[:nodeinfo] if nodeinfo.nil?
31
+ node_attributes << ope.attributes
32
32
  ope.run(@backend, ope.attributes)
33
33
  end
34
34
 
@@ -36,7 +36,7 @@ module Rundock
36
36
 
37
37
  @hooks.each do |h|
38
38
  Logger.debug("run hook: #{h.name}")
39
- h.hook(log_buffer, nodeinfo)
39
+ h.hook(node_attributes, log_buffer)
40
40
  end
41
41
 
42
42
  Logger.formatter.onrec = false
@@ -32,9 +32,9 @@ module Rundock
32
32
  # key: ~/.ssh/id_rsa
33
33
  # ---
34
34
  class File < Base
35
- def hook(log_buffer, node_info)
35
+ def hook(node_attributes, log_buffer)
36
36
  file = ::File.open(@contents[:filepath], 'w')
37
- file.puts("[hookname:#{@name} node:#{node_info[:host]}]")
37
+ file.puts("[hookname:#{@name} node:#{node_attributes[0][:nodename]}]")
38
38
  log_buffer.each do |log|
39
39
  file.puts("[\%5s:] %s%s\n" % [log.severity, ' ' * 2 * log.indent_depth, log.msg])
40
40
  end
@@ -1,3 +1,3 @@
1
1
  module Rundock
2
- VERSION = '0.4.8'
2
+ VERSION = '0.4.10'
3
3
  end
@@ -7,11 +7,13 @@ end
7
7
 
8
8
  describe file('/var/tmp/hello_rundock_from_file_hook_array_1_scenario') do
9
9
  it { should be_file }
10
+ its(:content) { should match(/anyhost-01/) }
10
11
  its(:content) { should match(/hookname:file_array_1 /) }
11
12
  end
12
13
 
13
14
  describe file('/var/tmp/hello_rundock_from_file_hook_array_2_scenario') do
14
15
  it { should be_file }
16
+ its(:content) { should match(/anyhost-01/) }
15
17
  its(:content) { should match(/hookname:file_array_2 /) }
16
18
  end
17
19
 
@@ -1,8 +1,10 @@
1
1
  - node: anyhost-01
2
2
  command:
3
3
  - "echo 'hookname:file_one ' > /var/tmp/hello_rundock_from_file_hook_one_scenario"
4
- - "echo 'hookname:file_array_1 ' > /var/tmp/hello_rundock_from_file_hook_array_1_scenario"
5
- - "echo 'hookname:file_array_2 ' > /var/tmp/hello_rundock_from_file_hook_array_2_scenario"
4
+ - "echo 'anyhost-01' > /var/tmp/hello_rundock_from_file_hook_array_1_scenario"
5
+ - "echo 'anyhost-01' > /var/tmp/hello_rundock_from_file_hook_array_2_scenario"
6
+ - "echo 'hookname:file_array_1 ' >> /var/tmp/hello_rundock_from_file_hook_array_1_scenario"
7
+ - "echo 'hookname:file_array_2 ' >> /var/tmp/hello_rundock_from_file_hook_array_2_scenario"
6
8
  hook:
7
9
  - file_one
8
10
  - file_array_1
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rundock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.8
4
+ version: 0.4.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - hiracy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-24 00:00:00.000000000 Z
11
+ date: 2015-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler