awful 0.0.11 → 0.0.12
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 +4 -4
- data/lib/awful/auto_scaling.rb +9 -2
- data/lib/awful/version.rb +1 -1
- 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: 6f0703571ca89556e9efc56775170d18aaab6373
|
4
|
+
data.tar.gz: 646f54dd08e397f6ea1ad1210ab66ab0c91a86f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ed049a0836cc96f60bebeed84562b1ded715cd322a0573a4c550f3d29d7e0e56cc6b63e81e06b460256ffc47489aa3c5fe5d281aac66b4df9ba8152fb6459c8
|
7
|
+
data.tar.gz: 667c2ad1e33fb85855a5f9e3def233cc5b45b1d9b0b800beeda9d1980190e1a893c0b3af3ae5c424156dd15928fdddf683bf9525fd36b1ab4c05ac3dd819de86
|
data/lib/awful/auto_scaling.rb
CHANGED
@@ -138,7 +138,11 @@ module Awful
|
|
138
138
|
instance_ids = autoscaling.describe_auto_scaling_instances.map(&:auto_scaling_instances).flatten.select do |instance|
|
139
139
|
instance.auto_scaling_group_name == name
|
140
140
|
end.map(&:instance_id)
|
141
|
-
|
141
|
+
if instance_ids.empty?
|
142
|
+
[]
|
143
|
+
else
|
144
|
+
ec2.describe_instances(instance_ids: instance_ids).map(&:reservations).flatten.map(&:instances).flatten.sort_by(&:launch_time)
|
145
|
+
end
|
142
146
|
end
|
143
147
|
|
144
148
|
## return array of instances in auto-scaling group, reverse sorted by age, newest first
|
@@ -156,7 +160,10 @@ module Awful
|
|
156
160
|
ins = options[:newest] ? newest(name) : oldest(name)
|
157
161
|
num = ins.length if options[:all] # all instances if requested
|
158
162
|
|
159
|
-
ins.
|
163
|
+
if ins.empty?
|
164
|
+
say 'No instances to terminate.', :green
|
165
|
+
else
|
166
|
+
ids = ins.first(num.to_i).map(&:instance_id)
|
160
167
|
if yes? "Really terminate #{num} instances: #{ids.join(',')}?", :yellow
|
161
168
|
ids.each do |id|
|
162
169
|
autoscaling.terminate_instance_in_auto_scaling_group(instance_id: id, should_decrement_desired_capacity: options[:decrement] && true)
|
data/lib/awful/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awful
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ric Lister
|
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
130
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.2.
|
131
|
+
rubygems_version: 2.2.2
|
132
132
|
signing_key:
|
133
133
|
specification_version: 4
|
134
134
|
summary: Simple AWS command-line tool.
|