cfncli 0.7.0 → 0.8.1

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDE5OTQwN2E1M2FiODUwZmQyOWZlNGM3Y2E5YWI5NmYwMTVjMGVlNQ==
4
+ OTFhM2IxNmEzYjFjMWZjYmY3NDUwNmNmZWZiYjZhMjljYTg5ZDA5Yw==
5
5
  data.tar.gz: !binary |-
6
- MjYwOWI3MGZkNDhmYzMyNzE2YmE0ODQ3OWZmMjliMTg2YzkxODg4MQ==
6
+ ZWQ0ZTE4NTg5MDNjODI2ZjI0ZjJiZWJhOGY3MzY4YzNhNTBkNDJhMg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ODVmNzI1MTg4ODMyN2E5Y2EwN2YyNTcxZjcyMTMzNWY4ODFmYmYxYTMwMzg1
10
- OTljYTU5ZjQ2ZGRkZWEzOTUxN2IxYTU0YjJiMTczMzM2MTMxMWVmZGZhMGMx
11
- ODZlOTcwNzlhMDM0ZmI1NTYxNjU0NmYyYTdjZmU5M2E3M2M3ZGQ=
9
+ YzI4OWZhMjg4OGRhYjkwODE2YjI2YWFhMjllMzI0YWU3NDY0NzQ3ZDcyZDlm
10
+ YzEwNDZiMGVjOTM5YjUxYmVlNzllZjY1MTFiM2RhNjU5ZGU5ODhlOGY4NTc0
11
+ NWZkZTBmZDExZjQ2Yjg4YzBiYTM0MjFkMmJmNTUwYTg1NmFkOTA=
12
12
  data.tar.gz: !binary |-
13
- OGI3OTVhZWJmNDI5NTUzY2YyNDA3Y2MwMmYzN2ZiMDI0ZTE0MzEzOTc1ZGRm
14
- M2UyMzgzYmZiMjU0NjhiZDNjMzJjOWRlODU0YTBiZmUwZDM1Y2U1YTJmNTM5
15
- OGVkZWZmNjE2YTcxZmM2ZmQyYWZjMDZhM2M0ZDhlMDFjY2E5NWE=
13
+ ZTBjZjQwZWM0NjU3M2Y2MDkzZThmYjQyNGVjNWE3YmU1OTY2ZDU5ZTA4MjBk
14
+ NTQ5Yzk2Y2NjNjNhODBkZmU2NTY4NWUyNDNlMjMyYzE2YTczMGFhNmJhYjJl
15
+ MWYyZmI4NDc1NDhjZTcxNGQ1ZGE2Y2Q2MGQyODZjNjhhMTAyZWE=
data/.gitignore CHANGED
@@ -1,6 +1,5 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
- /Gemfile.lock
4
3
  /_yardoc/
5
4
  /coverage/
6
5
  /doc/
data/.travis.yml CHANGED
@@ -13,6 +13,6 @@ deploy:
13
13
  on:
14
14
  tags: true
15
15
  addons:
16
- code_climate:
17
- repo_token:
18
- secure: "AKrgx5PtDa5/pek0hLgtk55SEE4DzCBM1li4eVCPK4CWfo7WgiODN51rnE7uhnABdaeI82t/YuJIyLE37PnsU4dqkXVBXtPmijBkbZy1SZ/bmTsSnOFoMTVWkaCb/iAcr+i5yqJ16bSGLV/t3K80ksyH80WgZTdzmh75pEDKaOBDLI42mgBf/eXkLZ68iuotatLnuLFwVa4mGW79yiJYBxHNstYHEBd0B4Ahutz3BMGFUiwCBx0wer+nVf+RxN+RKkiXRLnOeucwVEcbOOHbm1nkLDhL8U1KQ8lnWNV+RSUPNoOJNoMcgMRKMavDj6TC29e2pO44PWNgICCkUqbvc9Otrac5HG566ZsYZ0gp9BhQxEIpeYkzEUh7a/znLGiQYylrohIf9gsWz3KLGOPD68y4DZfmKgQDZG8ag1ErKmIv1Cna1PmsFA/lXUrZ60hIzgc0Vdw2jb7Ww2GHK35h8kSOCuDOOgmDpLhESvPVb7PPL2ftTLwSH6FT/P7wyfoeSqgotZTKZCw6JZAnV+HjwWB1uzR7dlt/H0qjduCVekWcK7Pq4lnlNI8S4tcAYiJSaL6EcCvrQ2qUAlw2xXYar0ouRgOQgM4H3HCleqkNIZwHxc3GYgdyhhPYqBr8Uq1ziT7NnQ4X94cCu9tuAcvKoqvQiJOKc4HUGCzgPnJiqL8="
16
+ # code_climate:
17
+ # repo_token:
18
+ # secure: "AKrgx5PtDa5/pek0hLgtk55SEE4DzCBM1li4eVCPK4CWfo7WgiODN51rnE7uhnABdaeI82t/YuJIyLE37PnsU4dqkXVBXtPmijBkbZy1SZ/bmTsSnOFoMTVWkaCb/iAcr+i5yqJ16bSGLV/t3K80ksyH80WgZTdzmh75pEDKaOBDLI42mgBf/eXkLZ68iuotatLnuLFwVa4mGW79yiJYBxHNstYHEBd0B4Ahutz3BMGFUiwCBx0wer+nVf+RxN+RKkiXRLnOeucwVEcbOOHbm1nkLDhL8U1KQ8lnWNV+RSUPNoOJNoMcgMRKMavDj6TC29e2pO44PWNgICCkUqbvc9Otrac5HG566ZsYZ0gp9BhQxEIpeYkzEUh7a/znLGiQYylrohIf9gsWz3KLGOPD68y4DZfmKgQDZG8ag1ErKmIv1Cna1PmsFA/lXUrZ60hIzgc0Vdw2jb7Ww2GHK35h8kSOCuDOOgmDpLhESvPVb7PPL2ftTLwSH6FT/P7wyfoeSqgotZTKZCw6JZAnV+HjwWB1uzR7dlt/H0qjduCVekWcK7Pq4lnlNI8S4tcAYiJSaL6EcCvrQ2qUAlw2xXYar0ouRgOQgM4H3HCleqkNIZwHxc3GYgdyhhPYqBr8Uq1ziT7NnQ4X94cCu9tuAcvKoqvQiJOKc4HUGCzgPnJiqL8="
data/Gemfile.lock ADDED
@@ -0,0 +1,130 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ cfncli (0.8.1)
5
+ activesupport (~> 4)
6
+ aws-sdk (~> 2)
7
+ colorize (~> 0)
8
+ concurrent-ruby (~> 1.0)
9
+ thor
10
+ waiting (~> 0)
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ activesupport (4.2.7.1)
16
+ i18n (~> 0.7)
17
+ json (~> 1.7, >= 1.7.7)
18
+ minitest (~> 5.1)
19
+ thread_safe (~> 0.3, >= 0.3.4)
20
+ tzinfo (~> 1.1)
21
+ aws-sdk (2.5.6)
22
+ aws-sdk-resources (= 2.5.6)
23
+ aws-sdk-core (2.5.6)
24
+ jmespath (~> 1.0)
25
+ aws-sdk-resources (2.5.6)
26
+ aws-sdk-core (= 2.5.6)
27
+ builder (3.2.2)
28
+ codeclimate-test-reporter (0.5.0)
29
+ simplecov (>= 0.7.1, < 1.0.0)
30
+ coderay (1.1.1)
31
+ colorize (0.8.1)
32
+ concurrent-ruby (1.0.2)
33
+ cucumber (2.3.3)
34
+ builder (>= 2.1.2)
35
+ cucumber-core (~> 1.4.0)
36
+ cucumber-wire (~> 0.0.1)
37
+ diff-lcs (>= 1.1.3)
38
+ gherkin (~> 3.2.0)
39
+ multi_json (>= 1.7.5, < 2.0)
40
+ multi_test (>= 0.1.2)
41
+ cucumber-core (1.4.0)
42
+ gherkin (~> 3.2.0)
43
+ cucumber-wire (0.0.1)
44
+ diff-lcs (1.2.5)
45
+ docile (1.1.5)
46
+ ffi (1.9.10)
47
+ formatador (0.2.5)
48
+ gherkin (3.2.0)
49
+ guard (2.13.0)
50
+ formatador (>= 0.2.4)
51
+ listen (>= 2.7, <= 4.0)
52
+ lumberjack (~> 1.0)
53
+ nenv (~> 0.1)
54
+ notiffany (~> 0.0)
55
+ pry (>= 0.9.12)
56
+ shellany (~> 0.0)
57
+ thor (>= 0.18.1)
58
+ guard-compat (1.2.1)
59
+ guard-rspec (4.6.5)
60
+ guard (~> 2.1)
61
+ guard-compat (~> 1.1)
62
+ rspec (>= 2.99.0, < 4.0)
63
+ i18n (0.7.0)
64
+ jmespath (1.3.1)
65
+ json (1.8.3)
66
+ listen (3.0.6)
67
+ rb-fsevent (>= 0.9.3)
68
+ rb-inotify (>= 0.9.7)
69
+ lumberjack (1.0.10)
70
+ method_source (0.8.2)
71
+ minitest (5.9.0)
72
+ multi_json (1.11.2)
73
+ multi_test (0.1.2)
74
+ nenv (0.3.0)
75
+ notiffany (0.0.8)
76
+ nenv (~> 0.1)
77
+ shellany (~> 0.0)
78
+ pry (0.10.3)
79
+ coderay (~> 1.1.0)
80
+ method_source (~> 0.8.1)
81
+ slop (~> 3.4)
82
+ rake (10.5.0)
83
+ rb-fsevent (0.9.7)
84
+ rb-inotify (0.9.7)
85
+ ffi (>= 0.5.0)
86
+ rspec (3.4.0)
87
+ rspec-core (~> 3.4.0)
88
+ rspec-expectations (~> 3.4.0)
89
+ rspec-mocks (~> 3.4.0)
90
+ rspec-core (3.4.4)
91
+ rspec-support (~> 3.4.0)
92
+ rspec-expectations (3.4.0)
93
+ diff-lcs (>= 1.2.0, < 2.0)
94
+ rspec-support (~> 3.4.0)
95
+ rspec-its (1.2.0)
96
+ rspec-core (>= 3.0.0)
97
+ rspec-expectations (>= 3.0.0)
98
+ rspec-mocks (3.4.1)
99
+ diff-lcs (>= 1.2.0, < 2.0)
100
+ rspec-support (~> 3.4.0)
101
+ rspec-support (3.4.1)
102
+ shellany (0.0.1)
103
+ simplecov (0.11.2)
104
+ docile (~> 1.1.0)
105
+ json (~> 1.8)
106
+ simplecov-html (~> 0.10.0)
107
+ simplecov-html (0.10.0)
108
+ slop (3.6.0)
109
+ thor (0.19.1)
110
+ thread_safe (0.3.5)
111
+ tzinfo (1.2.2)
112
+ thread_safe (~> 0.1)
113
+ waiting (0.3.0)
114
+
115
+ PLATFORMS
116
+ ruby
117
+
118
+ DEPENDENCIES
119
+ bundler (~> 1.10)
120
+ cfncli!
121
+ codeclimate-test-reporter
122
+ cucumber (~> 2)
123
+ guard (~> 2)
124
+ guard-rspec
125
+ rake (~> 10.0)
126
+ rspec
127
+ rspec-its (~> 1.2)
128
+
129
+ BUNDLED WITH
130
+ 1.12.5
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # cfncli
2
2
  [![Gem Version](https://badge.fury.io/rb/cfncli.svg)](https://badge.fury.io/rb/cfncli)
3
+ [![Build Status](https://travis-ci.org/lethalpaga/cfncli.svg?branch=master)](https://travis-ci.org/lethalpaga/cfncli)
3
4
  [![Code Climate](https://codeclimate.com/github/lethalpaga/cfncli/badges/gpa.svg)](https://codeclimate.com/github/lethalpaga/cfncli)
4
5
  [![Test Coverage](https://codeclimate.com/github/lethalpaga/cfncli/badges/coverage.svg)](https://codeclimate.com/github/lethalpaga/cfncli/coverage)
5
6
 
data/lib/cfncli/cli.rb CHANGED
@@ -110,6 +110,11 @@ module CfnCli
110
110
  default: true,
111
111
  desc: 'List the stack events during the operation'
112
112
 
113
+ method_option 'list_nested_events',
114
+ type: :boolean,
115
+ default: true,
116
+ desc: 'List events from nested stacks'
117
+
113
118
  method_option 'interval',
114
119
  type: :numeric,
115
120
  default: 10,
@@ -172,6 +177,11 @@ module CfnCli
172
177
  desc: 'Name or ID of the Cloudformation stack'
173
178
 
174
179
  # Application options.
180
+ method_option 'list_nested_events',
181
+ type: :boolean,
182
+ default: true,
183
+ desc: 'List events from nested stacks'
184
+
175
185
  method_option 'interval',
176
186
  type: :numeric,
177
187
  default: 10,
@@ -194,7 +204,7 @@ module CfnCli
194
204
  fail ArgumentError, 'stack_name is required' unless stack_name
195
205
 
196
206
  config = Config::CfnClient.new(options['interval'], options['retries'], options['retry_limit'])
197
- cfn.events(stack_name, config)
207
+ cfn.events(stack_name, config, options['list_nested_events'])
198
208
  end
199
209
 
200
210
  method_option 'stack_name',
@@ -11,6 +11,9 @@ module CfnCli
11
11
  include CfnClient
12
12
  include Loggable
13
13
 
14
+ # A list of options that only apply for stack creation
15
+ CREATE_ONLY_OPTIONS = %w(on_failure).freeze
16
+
14
17
  def initialize
15
18
  end
16
19
 
@@ -29,6 +32,7 @@ module CfnCli
29
32
  stack = create_stack_obj(stack_name, config)
30
33
 
31
34
  if stack.exists?
35
+ CREATE_ONLY_OPTIONS.each { |key| opts.delete key }
32
36
  stack.update(opts)
33
37
  else
34
38
  stack.create(opts)
@@ -41,16 +45,18 @@ module CfnCli
41
45
  def apply_and_list_events(options, config = nil)
42
46
  # Create/update the stack
43
47
  logger.debug "Creating stack #{options['stack_name']}"
48
+ list_nested_events = options['list_nested_events']
49
+ options.delete 'list_nested_events'
44
50
  stack = create_or_update_stack(options, config)
45
51
 
46
- events(stack, config)
52
+ events(stack, config, list_nested_events)
47
53
  Waiting.wait(interval: config.interval || default_config.interval, max_attempts: config.retries || default_config.retries) do |waiter|
48
54
  waiter.done if stack.finished? && !stack.listing_events?
49
- end
55
+ end
50
56
  end
51
57
 
52
58
  # List stack events
53
- def events(stack_or_name, config = nil, reset_events = true, poller = nil, streamer = nil)
59
+ def events(stack_or_name, config = nil, list_nested_events = true, reset_events = true, poller = nil, streamer = nil)
54
60
  stack = stack_or_name
55
61
  stack = create_stack_obj(stack_or_name, config) unless stack_or_name.is_a? CfnCli::Stack
56
62
 
@@ -60,7 +66,7 @@ module CfnCli
60
66
  streamer.reset_events if reset_events
61
67
 
62
68
  logger.debug "Listing events for stack #{stack.stack_name}"
63
- stack.list_events(poller, streamer, config)
69
+ stack.list_events(poller, streamer, config, nil, list_nested_events)
64
70
  end
65
71
 
66
72
  # Delete a stack
@@ -31,7 +31,9 @@ module CfnCli
31
31
  events.sort { |a, b| a.timestamp <=> b.timestamp }.each do |event|
32
32
  yield event unless seen?(event) if block_given?
33
33
  end
34
- end
34
+ rescue Aws::CloudFormation::Errors::ServiceError => e
35
+ raise unless e.class.name == 'Aws::CloudFormation::Errors::Throttling'
36
+ end
35
37
 
36
38
  # Mark all the existing events as 'seen'
37
39
  def reset_events
data/lib/cfncli/stack.rb CHANGED
@@ -95,11 +95,11 @@ module CfnCli
95
95
 
96
96
  # List all events in real time
97
97
  # @param poller [CfnCli::Poller] Poller class to display events
98
- def list_events(poller, streamer = nil, config = nil, event_prefix = nil)
98
+ def list_events(poller, streamer = nil, config = nil, event_prefix = nil, list_nested_events = true)
99
99
  @event_listing_thread = Thread.new do
100
100
  streamer ||= EventStreamer.new(self, config)
101
101
  streamer.each_event do |event|
102
- if Event.new(event).child_stack_create_event?
102
+ if list_nested_events && Event.new(event).child_stack_create_event?
103
103
  track_child_stack(event.physical_resource_id, event.logical_resource_id, poller)
104
104
  end
105
105
  poller.event(event, event_prefix)
@@ -1,3 +1,3 @@
1
1
  module CfnCli
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfncli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - lethalpaga
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-08 00:00:00.000000000 Z
11
+ date: 2016-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -204,6 +204,7 @@ files:
204
204
  - .rspec
205
205
  - .travis.yml
206
206
  - Gemfile
207
+ - Gemfile.lock
207
208
  - Guardfile
208
209
  - README.md
209
210
  - Rakefile