rundock 0.4.10 → 0.4.11

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: d57db6da4ef09d2b72d4100d7a0fefb1404bb06a
4
- data.tar.gz: 0d778d72fffd50b046d32d86300d2847de359b3a
3
+ metadata.gz: 6fb16148337d2df02dd98c9c568f73053ae4f0fe
4
+ data.tar.gz: 7146e8b107b4735c73b547e6627447bb71328ae2
5
5
  SHA512:
6
- metadata.gz: 09f7c9a551f014b35ed6ae5dc03279694805a2a4b9745f9db66560b362d7a4ede30aedd1c8bfb44b52c822c4a138fe719157fe7ec9171f2d0023b7e3e45f7772
7
- data.tar.gz: 65a57189d24d4da66da1652d0ee2ccd3b26b85d0f52bd6c05379cb37abfbd3fcfa4f82a9b23453d04d1a218d2c0ee6ba9c32fe92192447e64087552921c649c1
6
+ metadata.gz: d03e7b40cf4896e5ce763dd9ea1a46e0e4a560f33fb95f3d76f847fb3fd48c0aa89617fd1062d7ce3f67f5664df2f41d1cae53ad80f7f93416777f682bf1553c
7
+ data.tar.gz: 4b40aa2cde7aaa29c94bc8730e05ab537cc71bc5e4d18696bfe6b8c171c39228cf0e7fec4ea62894a73a1a570103a9da524cb02cd27eba3d6172b3b96d247b2d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## v0.4.11
2
+
3
+ Update
4
+
5
+ - Add dry_run state attribute for node info
6
+
7
+ Fix
8
+
9
+ - Fix task execute can not carry over attributes
10
+
1
11
  ## v0.4.9
2
12
 
3
13
  Update
@@ -6,10 +6,12 @@ module Rundock
6
6
  attr_accessor :task_info
7
7
  attr_accessor :errexit
8
8
  attr_accessor :enable_hooks
9
+ attr_accessor :dry_run
9
10
 
10
11
  AVAIL_TAKE_OVERS = [
11
12
  :task_info,
12
- :errexit
13
+ :errexit,
14
+ :dry_run
13
15
  ]
14
16
 
15
17
  def finalize_node
@@ -38,7 +38,7 @@ module Rundock
38
38
 
39
39
  next unless node
40
40
 
41
- ope = build_operations(k, Array(v), node_attribute, @options)
41
+ ope = build_operations(k, Array(v), node_attribute, @options, false)
42
42
  node.add_operation(ope) if ope
43
43
  end
44
44
  end
@@ -54,7 +54,7 @@ module Rundock
54
54
  scen = Scenario.new
55
55
 
56
56
  tasks.each do |k, v|
57
- ope = build_operations(k, Array(v), node_attribute, nil)
57
+ ope = build_operations(k, Array(v), node_attribute, nil, true)
58
58
  node.add_operation(ope) if ope
59
59
  end
60
60
 
@@ -84,16 +84,26 @@ module Rundock
84
84
  Rundock::OperationFactory.instance(:command).create(Array(command), node_attributes.list)
85
85
  end
86
86
 
87
- def build_operations(ope_type, ope_content, node_attributes, cli_options)
88
- if cli_options &&
89
- cli_options[:command] &&
87
+ def build_operations(ope_type, ope_content, node_attributes, cli_options, recursive)
88
+ cli_options = {} if cli_options.nil?
89
+
90
+ if cli_options[:command] &&
90
91
  (ope_type == :command || ope_type == :task)
91
92
  Logger.debug(%("--command or -c" option is specified and ignore scenario file.))
92
93
  return
93
94
  end
94
95
 
95
- node_attributes.errexit = !cli_options[:run_anyway] if cli_options
96
- node_attributes.errexit = true if cli_options.nil?
96
+ unless recursive
97
+ # apply cli options
98
+ if !cli_options.key?(:run_anyway)
99
+ node_attributes.errexit = true
100
+ else
101
+ node_attributes.errexit = !cli_options[:run_anyway]
102
+ end
103
+ node_attributes.dry_run = (cli_options && cli_options[:dry_run]) ? true : false
104
+ end
105
+
106
+ # override by scenario
97
107
  node_attributes.define_attr(ope_type, ope_content)
98
108
  Rundock::OperationFactory.instance(ope_type).create(Array(ope_content), node_attributes.list)
99
109
  end
@@ -11,6 +11,7 @@ module Rundock
11
11
  scenario = Rundock::Builder::ScenarioBuilder.new(nil, nil).build_task(
12
12
  attributes[:task_info][i.to_sym], backend, Rundock::Attribute::NodeAttribute.new(attributes))
13
13
 
14
+ Logger.info("start task: #{i}")
14
15
  scenario.run
15
16
  end
16
17
  end
@@ -1,3 +1,3 @@
1
1
  module Rundock
2
- VERSION = '0.4.10'
2
+ VERSION = '0.4.11'
3
3
  end
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.10
4
+ version: 0.4.11
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-27 00:00:00.000000000 Z
11
+ date: 2015-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler