sfn 1.0.2 → 1.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f61e628a6233ed4d119e00cf0dac4fa2c7346e8c
4
- data.tar.gz: f3831c51dd182d23e09cd955182e73cf0a10ffce
3
+ metadata.gz: 13adf8b1463f4e31619b3ba82661e9d181a576d6
4
+ data.tar.gz: 7f294f7cb3b0814f6e31fa3bc8c021084f26e5dd
5
5
  SHA512:
6
- metadata.gz: 36e914b73af9b09977c701c5e08849321d32adcbd5415534c7d3e9cb4c05535db5e521c74db2ac4274846ba1f33df6c592e65a65c7898c8e06a862f6628f3168
7
- data.tar.gz: 36eea79e6158f0601e8f6be8e0f0768ee4e14ddbc37e47f941b4c7cf2e605719e0623f78cbc809967377bdd32661cc3e8d40a8c6608d04d84e6aa38c8d486725
6
+ metadata.gz: 428044e1804b21057eb1ea2981d20377e3256396bc273f65a87e39b612dcd48a81f203c92a6e2931f06059574c681e950bf3a7614a6fd34901a63171267597bc
7
+ data.tar.gz: f0bec6f1774225739f12a9df1fb5919ad3e956449cd41290ca4e177c02cf6d0e171fe75a290bfaec3fbbef60c93923ee7fad6c9521299ef2034597ea363d2929
@@ -1,3 +1,8 @@
1
+ ## v1.0.4
2
+ * [fix] Set template prior to apply on update to find new parameters
3
+ * Disable parameter validation warning on deep nesting
4
+ * Update parameter detection on updates when using deep nesting
5
+
1
6
  ## v1.0.2
2
7
  * [fix] Properly detect local pack directory if available
3
8
  * Add `print` command for printing generated templates
data/README.md CHANGED
@@ -7,7 +7,7 @@ with orchestration APIs.
7
7
 
8
8
  ## Extra Documentation
9
9
 
10
- * [User Documentation](https://sparkleformation.github.io/sfn/UserDocs)
10
+ * [User Documentation](http://www.sparkleformation.io/docs/sfn/)
11
11
 
12
12
  ## API Compatibility
13
13
 
@@ -237,7 +237,7 @@ in JSON format. The `--processing` flag will allow providing Ruby
237
237
  files to dynamically generate templates using the SparkleFormation
238
238
  library.
239
239
 
240
- _NOTE: (SparkleFormation Usage Documentation)[]._
240
+ _NOTE: (SparkleFormation Usage Documentation)[http://www.sparkleformation.io/docs/sparkle_formation/]._
241
241
 
242
242
  This plugin supports the advanced stack nesting feature provided by
243
243
  the SparkleFormation library.
@@ -436,6 +436,7 @@ $ knife sparkleformation --help
436
436
  # Info
437
437
 
438
438
  * Repository: https://github.com/sparkleformation/sfn
439
+ * Website: http://www.sparkleformation.io/docs/sfn/
439
440
  * IRC: Freenode @ #sparkleformation
440
441
 
441
442
  [miasma]: http://miasma-rb.github.io/miasma/
@@ -25,7 +25,7 @@ module Sfn
25
25
  end
26
26
 
27
27
  unless(config[:print_only])
28
- ui.info "#{ui.color('Cloud Formation:', :bold)} #{ui.color('create', :green)}"
28
+ ui.info "#{ui.color('SparkleFormation:', :bold)} #{ui.color('create', :green)}"
29
29
  end
30
30
 
31
31
  stack_info = "#{ui.color('Name:', :bold)} #{name}"
@@ -44,7 +44,7 @@ module Sfn
44
44
  ui.error "Stack polling is not available when multiple stack deletion is requested!"
45
45
  end
46
46
  end
47
- ui.info " -> Destroyed Cloud Formation#{plural}: #{ui.color(stacks.join(', '), :bold, :red)}"
47
+ ui.info " -> Destroyed SparkleFormation#{plural}: #{ui.color(stacks.join(', '), :bold, :red)}"
48
48
  end
49
49
 
50
50
  # Cleanup persisted templates if nested stack resources are included
@@ -38,7 +38,7 @@ module Sfn
38
38
  raise "Failed to locate stack: #{name}"
39
39
  end
40
40
 
41
- ui.info "#{ui.color('Cloud Formation:', :bold)} #{ui.color('update', :green)}"
41
+ ui.info "#{ui.color('SparkleFormation:', :bold)} #{ui.color('update', :green)}"
42
42
 
43
43
  unless(file)
44
44
  if(config[:template])
@@ -50,18 +50,18 @@ module Sfn
50
50
  end
51
51
  ui.info " -> #{stack_info}"
52
52
 
53
- apply_stacks!(stack)
54
-
55
53
  if(file)
56
54
  if(config[:print_only])
57
55
  ui.puts _format_json(translate_template(file))
58
56
  return
59
57
  end
60
- populate_parameters!(file, :current_parameters => stack.parameters)
61
58
  stack.template = translate_template(file)
59
+ apply_stacks!(stack)
60
+ populate_parameters!(file, :current_parameters => stack.parameters)
62
61
  stack.parameters = config_root_parameters
63
62
  stack.template = Sfn::Utils::StackParameterScrubber.scrub!(stack.template)
64
63
  else
64
+ apply_stacks!(stack)
65
65
  populate_parameters!(stack.template, :current_parameters => stack.parameters)
66
66
  stack.parameters = config_root_parameters
67
67
  end
@@ -248,7 +248,7 @@ module Sfn
248
248
  answer = ui.ask_question("Use current value or expected value for #{p_key} [current/expected]?", :valid => ['current', 'expected'])
249
249
  answer == 'expected'
250
250
  else
251
- ui.warn "Unable to check #{p_key} for direct value modification. (Cannot auto-check expected value #{c_value.inspect})"
251
+ # ui.warn "Unable to check #{p_key} for direct value modification. (Cannot auto-check expected value #{c_value.inspect})"
252
252
  true
253
253
  end
254
254
  end
@@ -141,11 +141,21 @@ module Sfn
141
141
  run_callbacks_for(:template, :stack_name => stack_name, :sparkle_stack => stack)
142
142
  stack_definition = stack.compile.dump!
143
143
  stack_resource = resource._dump
144
+
145
+ if(stack.parent)
146
+ current_parameters = stack.parent.compile.dump!.to_smash.fetch('Resources', stack_name, 'Properties', 'Parameters', Smash.new)
147
+ else
148
+ current_parameters = Smash.new
149
+ end
150
+ current_stack = c_stack ? c_stack.nested_stacks.detect{|s| s.data[:logical_id] == stack_name} : nil
151
+ if(current_stack && current_stack.data[:parent_stack])
152
+ current_parameters.merge!(current_stack.data[:parent_stack].template.fetch('Resources', stack_name, 'Properties', 'Parameters', Smash.new))
153
+ end
144
154
  unless(config[:print_only])
145
155
  result = Smash.new(
146
156
  'Parameters' => populate_parameters!(stack,
147
- :stack => c_stack ? c_stack.nested_stacks.detect{|s| s.data[:logical_id] == stack_name} : nil,
148
- :current_parameters => c_stack ? c_stack.template.fetch('Resources', stack_name, 'Properties', 'Parameters', Smash.new) : stack_resource['Properties'].fetch('Parameters', {})
157
+ :stack => current_stack,
158
+ :current_parameters => current_parameters
149
159
  )
150
160
  )
151
161
  resource.properties.delete!(:stack)
@@ -196,7 +196,7 @@ module Sfn
196
196
  if(api.data.fetch(:stack_types, []).include?(resource.type))
197
197
  # Custom remote load support
198
198
  if(resource.type == 'Custom::JackalStack')
199
- location, stack_id = resource.id.split('-', 2)
199
+ location, stack_id = resource.id.to_s.split('-', 2)
200
200
  if(l_conf = api.data[:locations][location])
201
201
  n_stack = Miasma.api(
202
202
  :type => :orchestration,
@@ -1,4 +1,4 @@
1
1
  module Sfn
2
2
  # Current library version
3
- VERSION = Gem::Version.new('1.0.2')
3
+ VERSION = Gem::Version.new('1.0.4')
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sfn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-08 00:00:00.000000000 Z
11
+ date: 2015-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bogo-cli