sfn 0.3.6 → 0.3.8

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: cbcb24c6a5bbf11f586b4f9d4cc7513bbaa01ee7
4
- data.tar.gz: 16a2a3702fc4bfae5ae2028315e601d86f3db89d
3
+ metadata.gz: ccd51de01219d49eab04ff9c65a559496d12af4e
4
+ data.tar.gz: 54531dc80ac6f15fe3c712449533e74ea6c2706f
5
5
  SHA512:
6
- metadata.gz: de461be2611e95176b612abc639353a1a0a5d3001fe73d9d2db5212631a17c6a9928a6115aef8a10b577d8cd23be01ec13bc2a982129fe8d05a9a59a70ce32c6
7
- data.tar.gz: b2d224266a2eef7cdcbe6eec2291d0d9799b2e75ece20197fa126ca6435cbc6fb00b9eab0d5bdeeb8c1d4fef5de62dd949fdaf156dbf3904e5acb6001b8a7147
6
+ metadata.gz: e8fd31d72271d235c0e2a267cb0f978a95a61f0182cdebfed3e2e763efaa6a4222ab62c02d75e4544b8556f9a6dd5d941f120ffab01aa7b2743cc5996eb977f9
7
+ data.tar.gz: 4355c6cd7c2c75537c3c120bf5a961e1cd46e6483c3101ba144b12e2bcd0d273458300d8b2e3def53f10712fd93cdf5e67ec6907d04133eea6341da4790df3a0
@@ -1,3 +1,8 @@
1
+ ## v0.3.8
2
+ * Fix result output from `update` command (#9)
3
+ * Fix `inspect` command to properly support multiple attribute flags
4
+ * Only output JSON when using `--print-only` flag with `create` command (#10)
5
+
1
6
  ## v0.3.6
2
7
  * Set options correctly on `sfn` executable (#7)
3
8
  * Update cli library dependency to provide better error messages (#6)
@@ -24,7 +24,11 @@ module Sfn
24
24
  file = load_template_file
25
25
  nested_stacks_unpack = file.delete('sfn_nested_stack')
26
26
  end
27
- ui.info "#{ui.color('Cloud Formation:', :bold)} #{ui.color('create', :green)}"
27
+
28
+ unless(config[:print_only])
29
+ ui.info "#{ui.color('Cloud Formation:', :bold)} #{ui.color('create', :green)}"
30
+ end
31
+
28
32
  stack_info = "#{ui.color('Name:', :bold)} #{name}"
29
33
  if(config[:path])
30
34
  stack_info << " #{ui.color('Path:', :bold)} #{config[:file]}"
@@ -39,7 +43,7 @@ module Sfn
39
43
  else
40
44
 
41
45
  if(config[:print_only] && !config[:apply_stacks])
42
- ui.info _format_json(
46
+ ui.puts _format_json(
43
47
  translate_template(
44
48
  Sfn::Utils::StackParameterScrubber.scrub!(file)
45
49
  )
@@ -58,7 +62,7 @@ module Sfn
58
62
  stack.template = Sfn::Utils::StackParameterScrubber.scrub!(stack.template)
59
63
 
60
64
  if(config[:print_only])
61
- ui.info _format_json(translate_template(stack.template))
65
+ ui.puts _format_json(translate_template(stack.template))
62
66
  return
63
67
  end
64
68
 
@@ -90,29 +90,31 @@ module Sfn
90
90
  end
91
91
 
92
92
  def display_attribute(stack)
93
- attr = config[:attribute].split('.').inject(stack) do |memo, key|
94
- args = key.scan(/\(([^)]*)\)/).flatten.first.to_s
95
- if(args)
96
- args = args.split(',').map{|a| a.to_i.to_s == a ? a.to_i : a}
97
- key = key.split('(').first
98
- end
99
- if(memo.public_methods.include?(key.to_sym))
100
- if(args.size == 1 && args.first.to_s.start_with?('&'))
101
- memo.send(key, &args.first.slice(2, args.first.size).to_sym)
93
+ [config[:attribute]].flatten.compact.each do |stack_attribute|
94
+ attr = stack_attribute.split('.').inject(stack) do |memo, key|
95
+ args = key.scan(/\(([^)]*)\)/).flatten.first.to_s
96
+ if(args)
97
+ args = args.split(',').map{|a| a.to_i.to_s == a ? a.to_i : a}
98
+ key = key.split('(').first
99
+ end
100
+ if(memo.public_methods.include?(key.to_sym))
101
+ if(args.size == 1 && args.first.to_s.start_with?('&'))
102
+ memo.send(key, &args.first.slice(2, args.first.size).to_sym)
103
+ else
104
+ memo.send(*[key, args].flatten.compact)
105
+ end
102
106
  else
103
- memo.send(*[key, args].flatten.compact)
107
+ raise NoMethodError.new "Invalid attribute requested! (#{memo.class}##{key})"
104
108
  end
105
- else
106
- raise NoMethodError.new "Invalid attribute requested! (#{memo.class}##{key})"
107
109
  end
110
+ ui.info " Attribute Lookup -> #{config[:attribute]}:"
111
+ ui.puts MultiJson.dump(
112
+ MultiJson.load(
113
+ MultiJson.dump(attr)
114
+ ),
115
+ :pretty => true
116
+ )
108
117
  end
109
- ui.info " Attribute Lookup -> #{config[:attribute]}:"
110
- ui.puts MultiJson.dump(
111
- MultiJson.load(
112
- MultiJson.dump(attr)
113
- ),
114
- :pretty => true
115
- )
116
118
  end
117
119
 
118
120
  def display_nodes(stack)
@@ -69,7 +69,7 @@ module Sfn
69
69
 
70
70
  if(config[:poll])
71
71
  poll_stack(stack.name)
72
- if(stack.success?)
72
+ if(stack.reload.state == :update_complete)
73
73
  ui.info "Stack update complete: #{ui.color('SUCCESS', :green)}"
74
74
  namespace.const_get(:Describe).new({:outputs => true}, [name]).execute!
75
75
  else
@@ -1,4 +1,4 @@
1
1
  module Sfn
2
2
  # Current library version
3
- VERSION = Gem::Version.new('0.3.6')
3
+ VERSION = Gem::Version.new('0.3.8')
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: 0.3.6
4
+ version: 0.3.8
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-04-14 00:00:00.000000000 Z
11
+ date: 2015-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bogo-cli