knife-cloudformation 0.1.20 → 0.1.22

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.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## v0.1.22
2
+ * Prevent full stack list loading in knife commands
3
+ * Default logger to INFO level and allow DEBUG level via `ENV['DEBUG']`
4
+ * Fix assumption of type when accessing cached data (cannot assume availability)
5
+
1
6
  ## v0.1.20
2
7
  * Update some caching behavior
3
8
  * Add more logging especially around remote calls
Binary file
@@ -314,15 +314,19 @@ module KnifeCloudformation
314
314
  100
315
315
  else
316
316
  all_events = events(:all)
317
- total_expected = template['Resources'].size
318
- action = performing
319
- start = event_start_index(all_events, "#{action}_in_progress".to_sym)
320
- finished = all_events.find_all do |e|
321
- e['ResourceStatus'] == "#{action}_complete".upcase ||
322
- e['ResourceStatus'] == "#{action}_failed".upcase
323
- end.size
324
- calculated = ((finished / total_expected.to_f) * 100).to_i
325
- calculated < min ? min : calculated
317
+ if(all_events)
318
+ total_expected = template['Resources'].size
319
+ action = performing
320
+ start = event_start_index(all_events, "#{action}_in_progress".to_sym)
321
+ finished = all_events.find_all do |e|
322
+ e['ResourceStatus'] == "#{action}_complete".upcase ||
323
+ e['ResourceStatus'] == "#{action}_failed".upcase
324
+ end.size
325
+ calculated = ((finished / total_expected.to_f) * 100).to_i
326
+ calculated < min ? min : calculated
327
+ else
328
+ 100 # Assume deletion and no events == complete
329
+ end
326
330
  end
327
331
  end
328
332
 
@@ -18,6 +18,7 @@ module KnifeCloudformation
18
18
  unless(@logger)
19
19
  require 'logger'
20
20
  @logger = Logger.new($stdout)
21
+ @logger.level = ENV['DEBUG'] ? Logger::DEBUG : Logger::INFO
21
22
  end
22
23
  @logger
23
24
  end
@@ -133,8 +134,12 @@ module KnifeCloudformation
133
134
  end
134
135
  end
135
136
  end
136
- @memo[:stacks].value.find_all do |s|
137
- status.include?(s['StackStatus'])
137
+ if(@memo[:stacks].value)
138
+ @memo[:stacks].value.find_all do |s|
139
+ status.include?(s['StackStatus'])
140
+ end
141
+ else
142
+ []
138
143
  end
139
144
  end
140
145
 
@@ -200,7 +205,7 @@ module KnifeCloudformation
200
205
  def stack(*names)
201
206
  direct_load = names.delete(:ignore_seeds)
202
207
  result = names.map do |name|
203
- [name, name.start_with?('arn:') ? name : id_from_stack_name(name)]
208
+ [name, name.start_with?('arn:') || direct_load ? name : id_from_stack_name(name)]
204
209
  end.map do |name, s_id|
205
210
  unless(@local[:stacks][s_id])
206
211
  unless(direct_load)
@@ -2,5 +2,5 @@ module KnifeCloudformation
2
2
  class Version < Gem::Version
3
3
  end
4
4
 
5
- VERSION = Version.new('0.1.20')
5
+ VERSION = Version.new('0.1.22')
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-cloudformation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.22
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-10 00:00:00.000000000 Z
12
+ date: 2013-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef
@@ -150,9 +150,9 @@ files:
150
150
  - Gemfile
151
151
  - README.md
152
152
  - knife-cloudformation.gemspec
153
+ - knife-cloudformation-0.1.20.gem
153
154
  - CHANGELOG.md
154
155
  - Gemfile.lock
155
- - knife-cloudformation-0.1.18.gem
156
156
  homepage: http://github.com/heavywater/knife-cloudformation
157
157
  licenses: []
158
158
  post_install_message:
Binary file