vm_shepherd 1.9.0 → 1.9.1
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 +7 -1
- data/lib/vm_shepherd/version.rb +1 -1
- data/spec/vm_shepherd/aws_manager_spec.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7e502bced271f1b5046793bd8965232d23291a5
|
4
|
+
data.tar.gz: 8cfa8bde123a2bf7a238e3f5cab9e05abc0bfbf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2913b86106d6e4b57656a729291eb590dae6f9ac10bc99a9b8e5cb60a61e197515dae763f8c5957093847c01ea95a30b8154f1eff0ecb6fc2b10f7419c3da6b
|
7
|
+
data.tar.gz: 841d05a234ac68d9cb6147d29afa9f89cbf43e43d0f2ee106e7b66815907a42d6baf7298920b5fbb8befc628bd0fd9dd44e824065ec619835a39213c72e68c9e
|
@@ -174,7 +174,13 @@ module VmShepherd
|
|
174
174
|
def delete_elb(elb_name)
|
175
175
|
if (elb = AWS::ELB.new.load_balancers.find { |lb| lb.name == elb_name })
|
176
176
|
sg = elb.security_groups.first
|
177
|
-
net_interfaces = AWS.ec2.network_interfaces.select
|
177
|
+
net_interfaces = AWS.ec2.network_interfaces.select do |ni|
|
178
|
+
begin
|
179
|
+
ni.security_groups.map(&:id).include? sg.id
|
180
|
+
rescue AWS::EC2::Errors::InvalidNetworkInterfaceID::NotFound
|
181
|
+
false
|
182
|
+
end
|
183
|
+
end
|
178
184
|
logger.info("deleting elb: #{elb.name}")
|
179
185
|
elb.delete
|
180
186
|
logger.info('waiting until elb is deleted')
|
data/lib/vm_shepherd/version.rb
CHANGED
@@ -528,6 +528,18 @@ module VmShepherd
|
|
528
528
|
expect { ami_manager.clean_environment }.to raise_error(AwsManager::RetryLimitExceeded)
|
529
529
|
end
|
530
530
|
|
531
|
+
it 'does not care about network interfaces deleted by other processes' do
|
532
|
+
allow(network_interface_1_elb_1).to receive(:security_groups).and_raise(AWS::EC2::Errors::InvalidNetworkInterfaceID::NotFound)
|
533
|
+
|
534
|
+
expect(load_balancer_1_to_delete).to receive(:delete).ordered
|
535
|
+
expect(elb_1_security_group).to receive(:delete).ordered
|
536
|
+
|
537
|
+
expect(load_balancer_2_to_delete).to receive(:delete).ordered
|
538
|
+
expect(elb_2_security_group).to receive(:delete).ordered
|
539
|
+
|
540
|
+
ami_manager.clean_environment
|
541
|
+
end
|
542
|
+
|
531
543
|
it 'terminates the ELBs then removes the security group' do
|
532
544
|
expect(load_balancer_1_to_delete).to receive(:delete).ordered
|
533
545
|
expect(elb_1_security_group).to receive(:delete).ordered
|
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.9.
|
4
|
+
version: 1.9.1
|
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-
|
11
|
+
date: 2015-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-v1
|