smartos-manager 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smartos-manager/cli.rb +2 -1
- data/lib/smartos-manager/core.rb +7 -2
- data/lib/smartos-manager/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: 29841f2633b48a0b3157ce61b2e192a14c48475e
|
4
|
+
data.tar.gz: 2854a9fa98812383556aa13ac5a9495d68416346
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5faba60549136b532abd89709807a3dd4f2961ad601f7789f9c72e2f8339858b609819aec004174b427f457d97e569de04f51ab03a2d69760612a58113c8145b
|
7
|
+
data.tar.gz: 6ca13ee99a7bd442d4d5e62a143ea4cad53e06e78002914d3b629bd5fe40e13653117f47f0dcc4e95bf1ffa34345c8e8a423f14dc8d49cdd502f905eed3c99d5
|
data/lib/smartos-manager/cli.rb
CHANGED
@@ -22,7 +22,8 @@ class AppCLI < Thor
|
|
22
22
|
vms.each{|vm| vm_memory += vm.memory }
|
23
23
|
avail = (mem - vm_memory) - (20 * mem/100.0)
|
24
24
|
|
25
|
-
|
25
|
+
rev = sysinfos[host][:smartos_version]
|
26
|
+
puts "\n#{host.name} [SmartOS: #{rev.green}] (#{host.address}) (#{vms.size} vms) (Total RAM: #{mem.human_size(1).green}, Avail: #{avail.human_size(1).magenta})"
|
26
27
|
vms.each do |vm|
|
27
28
|
user_columns = registry.user_columns.values.map{|key| vm[key] }
|
28
29
|
p_vm_list(vm.memory.human_size(1), vm.name, vm.type, vm.uuid, printable_state(vm.state), vm.admin_ip, *user_columns)
|
data/lib/smartos-manager/core.rb
CHANGED
@@ -148,12 +148,17 @@ class HostRegistry
|
|
148
148
|
ret = {}
|
149
149
|
|
150
150
|
# Memory size: 8157 Megabytes
|
151
|
-
|
152
|
-
hosts.each do |host, data|
|
151
|
+
run_on_all("prtconf | head -3 | grep Mem").each do |host, data|
|
153
152
|
_, _, mem, _ = data.split(" ")
|
154
153
|
ret[host] = {memory: mem.to_i.megabytes}
|
155
154
|
end
|
156
155
|
|
156
|
+
# joyent_20140207T053435Z
|
157
|
+
run_on_all("uname -a | cut -d ' ' -f 4").each do |host, data|
|
158
|
+
_, rev = data.strip().split('_')
|
159
|
+
ret[host][:smartos_version] = rev
|
160
|
+
end
|
161
|
+
|
157
162
|
ret
|
158
163
|
end
|
159
164
|
|
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.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Ammous
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: toml-rb
|