smartos-manager 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62b523db761a6c566da3f141b0a6ae32e35fa214
4
- data.tar.gz: 7bed70aa00d9635c9467cd73773069c4860a56d6
3
+ metadata.gz: 623bb38ba01a9e00f9bd141beca2340cc705700c
4
+ data.tar.gz: c4f2d566102caeb8de069eef4e57a1d4265c631c
5
5
  SHA512:
6
- metadata.gz: ab4d3d05461ab02addf9676958d693862c1528d7486fb20b3b618c8ae58aa3fdd09092c8eb720b2427b3422dfe81a6bab788abaee117965b8a9b5d7b8674d30e
7
- data.tar.gz: 1fe5548be72889bb674efbfd2b12a7992081c1bbc60b10e15d451ecd789ec43c91adfba6629f717c66e7d91da74fe1d93ed0d28c68c80c7ae8276fb7d8223147
6
+ metadata.gz: c1e8dbba3850f91ef503260bf7c5f691e322880a200deb16940bdf79ac6df332d68fccd27a91f09d87e7fa1913ea8b1ad194299518d91915e4429a0014d47d86
7
+ data.tar.gz: b6d64d6fa46c2baad1366b3635920719e06d77c089aff5df6b183f086a9632bcf2718458c50743b17a6fc841b14c6a4cfdace1b65e4c9993a4bb39d6c99d88fd
data/Gemfile CHANGED
@@ -4,14 +4,14 @@ gemspec
4
4
 
5
5
  gem 'rake'
6
6
 
7
- group(:test) do
8
- gem 'eetee', '~> 0.0.4'
9
- gem 'mocha', '~> 0.12.0'
10
- # gem 'factory_girl'
11
- gem 'rb-blink1'
12
-
13
- gem 'simplecov'
14
- gem 'guard'
15
- gem 'rb-fsevent'
16
- gem 'growl'
17
- end
7
+ # group(:test) do
8
+ # gem 'eetee', '~> 0.0.4'
9
+ # gem 'mocha', '~> 0.12.0'
10
+ # # gem 'factory_girl'
11
+ # gem 'rb-blink1'
12
+ #
13
+ # gem 'simplecov'
14
+ # gem 'guard'
15
+ # gem 'rb-fsevent'
16
+ # gem 'growl'
17
+ # end
@@ -63,6 +63,17 @@ class AppCLI < Thor
63
63
  sysinfos = registry.sysinfo()
64
64
  diags = registry.diag()
65
65
 
66
+ failures = registry.failed_connections()
67
+ unless failures.empty?
68
+ puts "Error while connecting to:".red()
69
+ failures.each do |s|
70
+ puts " - #{s.name} : #{s.address}".red()
71
+ end
72
+
73
+ puts ""
74
+ end
75
+
76
+
66
77
  user_columns = registry.user_columns.keys.map{|s| humanize(s) }
67
78
 
68
79
  p_vm_list("Memory", "Name (gray = online)", "Type", "UUID", "State", "Admin IP", "DD(GB)", *user_columns)
@@ -174,13 +174,16 @@ class Registry
174
174
 
175
175
  run_on_all("prtdiag").each do |addr, data|
176
176
  host = find_host(addr)
177
+ system_id = "(none)"
177
178
  free_memory_banks = 0
178
179
 
179
- system_id = data.match(/^System Configuration: (.+)$/)[1]
180
- data.scan(/(empty).*DIMM\s+([0-9])/).each do |reg|
181
- free_memory_banks+= 1
180
+ if matches = data.match(/^System Configuration: (.+)$/)
181
+ system_id = mastches[1]
182
+ data.scan(/(empty).*DIMM\s+([0-9])/).each do |reg|
183
+ free_memory_banks+= 1
184
+ end
182
185
  end
183
-
186
+
184
187
  ret[host] = {
185
188
  system_id: system_id,
186
189
  free_memory_banks: free_memory_banks
@@ -301,28 +304,31 @@ class SSHRegistry < Registry
301
304
  puts "(( Using live data ))"
302
305
  super
303
306
 
307
+ @failed_connections = []
308
+
304
309
  @gateways = {}
305
- @connection = Net::SSH::Multi.start()
310
+ @connection = Net::SSH::Multi.start(:on_error => ->(server){
311
+ @failed_connections << server.host
312
+ })
306
313
 
307
314
  @hosts.each do |_, host|
308
315
  @connection.use(host.address,
309
316
  via: gateway_for(host.gateway, host.gateway_user),
310
- # via: @gateways[host.gateway],
311
317
  user: host.user,
312
318
  timeout: 20,
319
+ auth_methods: %w(publickey),
313
320
  compression: false
314
321
  )
315
322
  end
316
-
317
323
  end
318
324
 
319
325
  def run_on_all(cmd)
320
326
  ret = {}
321
327
 
322
328
  # set the keys in cas we get nothing back
323
- @hosts.each do |addr, _|
324
- ret[addr] = ""
325
- end
329
+ # @hosts.each do |addr, _|
330
+ # ret[addr] = ""
331
+ # end
326
332
 
327
333
  channel = @connection.exec(cmd) do |ch, stream, data|
328
334
  host = @hosts[ch[:host]]
@@ -335,6 +341,10 @@ class SSHRegistry < Registry
335
341
 
336
342
  ret
337
343
  end
344
+
345
+ def failed_connections
346
+ @failed_connections.map{|address| @hosts[address] }
347
+ end
338
348
 
339
349
  private
340
350
  def gateway_for(host, user)
@@ -1,3 +1,3 @@
1
1
  module SmartosManager
2
- VERSION = "1.5.1"
2
+ VERSION = "1.5.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartos-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Ammous
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-03 00:00:00.000000000 Z
11
+ date: 2015-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toml-rb