aly 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/aly/app.rb +7 -7
- data/lib/aly/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 929950a91790b6ca3522f18cb114d29d58ccc1d4c61e4de6b649198d5624ecf3
|
4
|
+
data.tar.gz: 0c55d48418ec5a8661f8ef912dc7fc647514c99be0c14964a2f2d7fb4ed78198
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3e21c88c0dc447b9ca035786bbe4f1c4504f148a7731cb9cc8b9d1205152392e5e83d7fb702aaefd6f20ffb5acea3fc22677f3bccd20332c0914391ceae2e30
|
7
|
+
data.tar.gz: da9a871f358fa988084dc84f5498c3800bd6eefc8467dcae6faf81fc7f4a2aab60cc6128cf84d387103ff92b658611dda502c4a9f1beb2162100749a6dc0b3e8
|
data/Gemfile.lock
CHANGED
data/lib/aly/app.rb
CHANGED
@@ -23,7 +23,7 @@ module Aly
|
|
23
23
|
|
24
24
|
def ecs(*args, **options)
|
25
25
|
raw_out = exec('ecs', 'DescribeInstances', '--pager', **options)
|
26
|
-
selected = raw_out['Instances']['Instance'].each do |item|
|
26
|
+
selected = (raw_out['Instances']['Instance'] || []).each do |item|
|
27
27
|
item['PrivateIP'] = (item['NetworkInterfaces']['NetworkInterface'] || []).map { |ni| ni['PrimaryIpAddress'] }.join(',')
|
28
28
|
item['PublicIP'] = item['EipAddress']['IpAddress'] || ''
|
29
29
|
item['PublicIP'] = item['PublicIpAddress']['IpAddress'].join(',') if item['PublicIP'] == ''
|
@@ -92,9 +92,9 @@ module Aly
|
|
92
92
|
|
93
93
|
def slb(*args, **options)
|
94
94
|
raw_out = exec('slb', 'DescribeLoadBalancers', '--pager', **options)
|
95
|
-
selected = raw_out['LoadBalancers']['LoadBalancer']
|
95
|
+
selected = raw_out['LoadBalancers']['LoadBalancer'] || []
|
96
96
|
|
97
|
-
listeners = exec('slb', 'DescribeLoadBalancerListeners', '--pager', 'path=Listeners', **options)['Listeners'].each_with_object({}) do |listener, result|
|
97
|
+
listeners = (exec('slb', 'DescribeLoadBalancerListeners', '--pager', 'path=Listeners', **options)['Listeners'] || []).each_with_object({}) do |listener, result|
|
98
98
|
instance_id = listener['LoadBalancerId']
|
99
99
|
result[instance_id] ||= []
|
100
100
|
result[instance_id] << listener
|
@@ -156,7 +156,7 @@ module Aly
|
|
156
156
|
end
|
157
157
|
|
158
158
|
def show_slb(host, **options)
|
159
|
-
@listeners ||= exec('slb', 'DescribeLoadBalancerListeners', '--pager', 'path=Listeners', **options)['Listeners']
|
159
|
+
@listeners ||= exec('slb', 'DescribeLoadBalancerListeners', '--pager', 'path=Listeners', **options)['Listeners'] || []
|
160
160
|
lb = @slb.find { |e| e['Address'] == host }
|
161
161
|
listeners = @listeners.select { |e| e['LoadBalancerId'] == lb['LoadBalancerId'] }
|
162
162
|
background_servers = exec('slb', 'DescribeLoadBalancerAttribute', "--LoadBalancerId=#{lb['LoadBalancerId']}", **options)['BackendServers']['BackendServer']
|
@@ -254,11 +254,11 @@ module Aly
|
|
254
254
|
end
|
255
255
|
|
256
256
|
def show(*args, **options)
|
257
|
-
@slb ||= exec('slb', 'DescribeLoadBalancers', '--pager', **options)['LoadBalancers']['LoadBalancer']
|
257
|
+
@slb ||= exec('slb', 'DescribeLoadBalancers', '--pager', **options)['LoadBalancers']['LoadBalancer'] || []
|
258
258
|
|
259
|
-
@eip ||= exec('vpc', 'DescribeEipAddresses', '--PageSize=100', **options)['EipAddresses']['EipAddress']
|
259
|
+
@eip ||= exec('vpc', 'DescribeEipAddresses', '--PageSize=100', **options)['EipAddresses']['EipAddress'] || []
|
260
260
|
unless @ecs
|
261
|
-
@ecs = exec('ecs', 'DescribeInstances', '--pager', **options)['Instances']['Instance']
|
261
|
+
@ecs = exec('ecs', 'DescribeInstances', '--pager', **options)['Instances']['Instance'] || []
|
262
262
|
@ecs.each do |item|
|
263
263
|
item['PrivateIP'] = (item['NetworkInterfaces']['NetworkInterface'] || []).map { |ni| ni['PrimaryIpAddress'] }
|
264
264
|
item['PublicIP'] = []
|
data/lib/aly/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liu Xiang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|