vm_shepherd 1.11.8 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vm_shepherd/aws_manager.rb +2 -2
- data/lib/vm_shepherd/retry_helper.rb +2 -2
- data/lib/vm_shepherd/version.rb +1 -1
- data/spec/vm_shepherd/aws_manager_spec.rb +16 -2
- data/vm_shepherd.gemspec +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 128595ea5d161fca2968a78cf51497f78f2ec9a5
|
4
|
+
data.tar.gz: d1a7136a462f00640aa928e9aae9a6cd88475212
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b723a9e0f0323bbac7f4a50bbfdd021987681c57183ddcb344c11d473997158eb656e86f53c6a41535cbddc766e215d5d5bf7e9396c4516971cef8559477408d
|
7
|
+
data.tar.gz: 695902d740ada2ecb721d7b6ce5b66f7b2faf4be5a71da1cff28d583d3e882cf278e2bc3e8cb0ddb999f8dc960a89b46dd6b43496f123782dae1b2a768da1355
|
@@ -34,7 +34,7 @@ module VmShepherd
|
|
34
34
|
stack = cfm.stacks.create(env_config.fetch(:stack_name), template, parameters: env_config.fetch(:parameters), capabilities: ['CAPABILITY_IAM'])
|
35
35
|
|
36
36
|
logger.info("Waiting for status: #{CREATE_COMPLETE}")
|
37
|
-
retry_until(retry_limit: 30) do
|
37
|
+
retry_until(retry_limit: 30, retry_interval: 300) do
|
38
38
|
status = stack.status
|
39
39
|
logger.info("current stack status: #{status}")
|
40
40
|
case status
|
@@ -239,7 +239,7 @@ module VmShepherd
|
|
239
239
|
logger.info('deleting CloudFormation stack')
|
240
240
|
stack.delete
|
241
241
|
logger.info("waiting until status: #{DELETE_COMPLETE}")
|
242
|
-
retry_until(retry_limit: 30) do
|
242
|
+
retry_until(retry_limit: 30, retry_interval: 300) do
|
243
243
|
begin
|
244
244
|
status = stack.status
|
245
245
|
logger.info("current stack status: #{status}")
|
@@ -6,7 +6,7 @@ module VmShepherd
|
|
6
6
|
RETRY_LIMIT = 10
|
7
7
|
RETRY_INTERVAL = 60
|
8
8
|
|
9
|
-
def retry_until(retry_limit: RETRY_LIMIT, &block)
|
9
|
+
def retry_until(retry_limit: RETRY_LIMIT, retry_interval: RETRY_INTERVAL, &block)
|
10
10
|
tries = 0
|
11
11
|
condition_reached = false
|
12
12
|
loop do
|
@@ -14,7 +14,7 @@ module VmShepherd
|
|
14
14
|
raise(RetryLimitExceeded) if tries > retry_limit
|
15
15
|
condition_reached = block.call
|
16
16
|
break if condition_reached
|
17
|
-
sleep
|
17
|
+
sleep retry_interval
|
18
18
|
end
|
19
19
|
condition_reached
|
20
20
|
end
|
data/lib/vm_shepherd/version.rb
CHANGED
@@ -71,6 +71,12 @@ module VmShepherd
|
|
71
71
|
end
|
72
72
|
|
73
73
|
describe 'cloudformation' do
|
74
|
+
it 'polls the status every 300 seconds' do
|
75
|
+
expect(ami_manager).to receive(:retry_until).with(retry_limit: 30, retry_interval: 300)
|
76
|
+
|
77
|
+
ami_manager.prepare_environment(cloudformation_template_file.path)
|
78
|
+
end
|
79
|
+
|
74
80
|
it 'creates the stack with the correct parameters' do
|
75
81
|
expect(stack_collection).to receive(:create).with(
|
76
82
|
'aws-stack-name',
|
@@ -89,7 +95,7 @@ module VmShepherd
|
|
89
95
|
ami_manager.prepare_environment(cloudformation_template_file.path)
|
90
96
|
end
|
91
97
|
|
92
|
-
it 'stops retrying after
|
98
|
+
it 'stops retrying after 30 times' do
|
93
99
|
expect(stack).to receive(:status).and_return('CREATE_IN_PROGRESS').
|
94
100
|
exactly(30).times
|
95
101
|
|
@@ -366,6 +372,12 @@ module VmShepherd
|
|
366
372
|
ami_manager.clean_environment
|
367
373
|
end
|
368
374
|
|
375
|
+
it 'polls the status every 300 seconds' do
|
376
|
+
expect(ami_manager).to receive(:retry_until).with(retry_limit: 30, retry_interval: 300)
|
377
|
+
|
378
|
+
ami_manager.clean_environment
|
379
|
+
end
|
380
|
+
|
369
381
|
it 'deletes the stack' do
|
370
382
|
expect(stack_collection).to receive(:[]).with('aws-stack-name').and_return(stack)
|
371
383
|
expect(stack).to receive(:delete)
|
@@ -378,13 +390,15 @@ module VmShepherd
|
|
378
390
|
ami_manager.clean_environment
|
379
391
|
end
|
380
392
|
|
381
|
-
it 'stops retrying after
|
393
|
+
it 'stops retrying after 30 times' do
|
382
394
|
expect(stack).to receive(:status).and_return('DELETE_IN_PROGRESS').
|
383
395
|
exactly(30).times
|
384
396
|
|
385
397
|
expect { ami_manager.clean_environment }.to raise_error(AwsManager::RetryLimitExceeded)
|
386
398
|
end
|
387
399
|
|
400
|
+
|
401
|
+
|
388
402
|
it 'aborts if stack reports unexpected status' do
|
389
403
|
expect(stack).to receive(:status).and_return('DELETE_IN_PROGRESS', 'UNEXPECTED_STATUS').ordered
|
390
404
|
expect {
|
data/vm_shepherd.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vm_shepherd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ops Manager Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-v1
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: fog
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.34.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.34.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: ruby_vcloud_sdk
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
217
|
version: '0'
|
218
218
|
requirements: []
|
219
219
|
rubyforge_project:
|
220
|
-
rubygems_version: 2.4.
|
220
|
+
rubygems_version: 2.4.8
|
221
221
|
signing_key:
|
222
222
|
specification_version: 4
|
223
223
|
summary: A tool for booting and tearing down Ops Manager VMs on various Infrastructures.
|