kafo 0.6.10 → 0.6.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: 0b6ffa265250c49b12e016bc63f962c8bb79f81c
4
- data.tar.gz: 4b32a26582cfd6b257f91b27bbd8a5ef53a80410
3
+ metadata.gz: d356aabda9fad9af796d3871dd9c8bd96b14b757
4
+ data.tar.gz: 294fa5e00481474a926c7fa2ce15f04135636150
5
5
  SHA512:
6
- metadata.gz: f0d000c16759db40e7b7b414a842ad1a3c553bb34e0d49f2733a884012caf3a118c3515b27eafff652050d4f1c4db0587bb241d251d59df3e301e27ed3961f9d
7
- data.tar.gz: 4a6f363efca30b67a8db7aa080376dfdcf43d123b944e1b0bb4005561c2161f0120dbe470f0cdca68e5a08425e72579a29af16556557c6106b9f0bc0e40fc1ed
6
+ metadata.gz: fdf82c1c6d3ceb029d8ec780b0d31dfbf377bacb2e394924e474eeee297415d4364d87a4a93654122c8f4355913dd4ddd34a41d3551f5cf0c693ed5d63adfd1f
7
+ data.tar.gz: 46ed06896fe0ded9f893792c9056d5cc5da8830debb9ca14f4a806546662def8b6bd7d7a2f0fb5bdc0ae6f586c7f35a2712d99a4331d41c9e483bfe4460aa7c0
data/README.md CHANGED
@@ -259,7 +259,7 @@ in the puppet manifest documentation like this
259
259
  type:boolean
260
260
  ```
261
261
 
262
- Supported types are: string, boolean, integer, array, password
262
+ Supported types are: string, boolean, integer, array, password, hash
263
263
 
264
264
  Note that all arguments that are nil (have no value in answers.yaml or you
265
265
  set them UNDEF (see below)) are translated to ```undef``` in puppet.
@@ -522,7 +522,8 @@ We currently support the following hooks.
522
522
  * init - just after hooking is initialized and kafo is configured, parameters have no values yet
523
523
  * pre_values - just before value from CLI is set to parameters (they already have default values)
524
524
  * pre_validations - just after system checks and before validations are executed (and before interactive wizard is started), at this point all parameter values are already set but not yet stored in answer file
525
- * pre - just before puppet is executed to converge system
525
+ * pre_commit - after validations or interactive wizard have completed, all parameter values are set but not yet stored in the answer file
526
+ * pre - just before puppet is executed to converge system, after parameter values are stored in the answer file
526
527
  * post - just after puppet is executed to converge system
527
528
 
528
529
  Let's assume we want to add the ```--reset-foreman-db``` option to our
@@ -6,9 +6,10 @@ module Kafo
6
6
  # init - just after hooking is initialized and kafo is configured, parameters have no values yet
7
7
  # pre_values - just before value from CLI is set to parameters (they already have default values)
8
8
  # pre_validations - just after system checks and before validations are executed (and before interactive wizard is started), at this point all parameter values are already set but not yet stored in answer file
9
+ # pre_commit - after validations or interactive wizard have completed, all parameter values are set but not yet stored in the answer file
9
10
  # pre - just before puppet is executed to converge system
10
11
  # post - just after puppet is executed to converge system
11
- TYPES = [:boot, :init, :pre, :post, :pre_values, :pre_validations]
12
+ TYPES = [:boot, :init, :pre, :post, :pre_values, :pre_validations, :pre_commit]
12
13
 
13
14
  attr_accessor :hooks, :kafo
14
15
 
@@ -68,6 +69,10 @@ module Kafo
68
69
  register(:pre_validations, name, &block)
69
70
  end
70
71
 
72
+ def register_pre_commit(name, &block)
73
+ register(:pre_commit, name, &block)
74
+ end
75
+
71
76
  def register_pre(name, &block)
72
77
  register(:pre, name, &block)
73
78
  end
@@ -102,6 +102,7 @@ module Kafo
102
102
  end
103
103
  end
104
104
 
105
+ self.class.hooking.execute(:pre_commit)
105
106
  if dont_save_answers? || noop?
106
107
  self.class.temp_config_file = temp_config_file
107
108
  store_params(temp_config_file)
@@ -89,13 +89,7 @@ module Kafo
89
89
  end
90
90
 
91
91
  validator = Validator.new([self])
92
- validations.map! do |v|
93
- result = v.evaluate(validator)
94
- # validate_re returns nil if succeeds
95
- result = true if v.name == 'validate_re' && result.nil?
96
- result
97
- end
98
-
92
+ validations.map! { |v| v.evaluate(validator) }
99
93
  validations.all?
100
94
  end
101
95
 
@@ -51,6 +51,7 @@ module Kafo
51
51
  if engine.respond_to? method
52
52
  @logger.debug "calling #{method.inspect} with #{args.inspect}"
53
53
  engine.send(method, *args)
54
+ true
54
55
  else
55
56
  raise Puppet::DevError, "Function #{$1} not defined despite being loaded!"
56
57
  end
@@ -1,4 +1,4 @@
1
1
  # encoding: UTF-8
2
2
  module Kafo
3
- VERSION = "0.6.10"
3
+ VERSION = "0.6.11"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kafo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.10
4
+ version: 0.6.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Hulan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-28 00:00:00.000000000 Z
11
+ date: 2015-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler