staypuft 0.2.2 → 0.2.3

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: 3b0e05b324e38d1dc083bdd6ed82f0fcd0859991
4
- data.tar.gz: 931bb580e72de0778a64de04601808ac5c2a1d01
3
+ metadata.gz: 649e6b74832134eb32e65dc093a3ee06a95f6f35
4
+ data.tar.gz: 2820cd2146364cba2011cb93183aa9043acef7d8
5
5
  SHA512:
6
- metadata.gz: ee8c8ccff0fb497adce623790cbd4dc48e074b55670a73cade664c962c8010547095681b6c782dd14c123fc7deab89fcbc77b3dfb97d1e268f215e605ee0bf65
7
- data.tar.gz: 0d259f68904d837a3377c3dbd022ff187678c8cae3b0aecd8dc2669f3f5f3666b348a2281b7661ab01ef2e7028fe053ff08f813e3ff614c5dabb632d311f7a98
6
+ metadata.gz: 277934325a63af0c682e8fc7c126e2e170b4582516eaa8f3cb2518498cedd39b23ef45e66beb52cecc1c0ea8e0b07cffdd1d6fd51fcff93c40821cf82fef7690
7
+ data.tar.gz: e18505d768ab7a0a876af874be7e3ff04fbea846cd95d21d0ff21475441b86022326b133660b140b59b6e80b55ebc2374e9220cdb9f00536d21cd69a0a323b45
@@ -342,7 +342,6 @@ module Staypuft
342
342
  'swift_shared_secret' => swift_shared_secret,
343
343
  'swift_ringserver_ip' => '',
344
344
  'swift_storage_ips' => { :array => '<%= @host.deployment.ips.controller_ips %>' },
345
- 'cinder_nfs_shares' => [],
346
345
  'cinder_gluster_shares' => [],
347
346
  'controller_admin_host' => controller_host,
348
347
  'controller_priv_host' => controller_host,
@@ -416,7 +415,6 @@ module Staypuft
416
415
  'swift_shared_secret' => swift_shared_secret,
417
416
  'swift_ringserver_ip' => '',
418
417
  'swift_storage_ips' => { :array => '<%= @host.deployment.ips.controller_ips %>' },
419
- 'cinder_nfs_shares' => [],
420
418
  'cinder_gluster_shares' => [],
421
419
  'controller_admin_host' => controller_host,
422
420
  'controller_priv_host' => controller_host,
@@ -5,8 +5,20 @@ module Staypuft
5
5
 
6
6
  # Returns memory in GB
7
7
  def mem
8
- if self.facts_hash["memorytotal"]
9
- self.facts_hash["memorytotal"].split(" ").first.to_f / 1000
8
+ mem_arr = self.facts_hash["memorytotal"]
9
+ if mem_arr
10
+ mem_str, mem_unit = mem_arr.split(" ")
11
+ mem_number = mem_str.to_f
12
+ case mem_unit
13
+ when "MB"
14
+ mem_number / 1024
15
+ when "GB"
16
+ mem_number
17
+ when "TB"
18
+ mem_number * 1024
19
+ else
20
+ nil
21
+ end
10
22
  else
11
23
  nil
12
24
  end
@@ -1,5 +1,3 @@
1
- require 'resolv'
2
-
3
1
  module Staypuft
4
2
  class Deployment::IPS < Deployment::AbstractParamScope
5
3
 
@@ -12,9 +10,7 @@ module Staypuft
12
10
  end
13
11
 
14
12
  def controller_ips
15
- controllers.map do |controller|
16
- ip_for_controller(controller)
17
- end
13
+ controllers.map &:ip
18
14
  end
19
15
 
20
16
  def controller_fqdns
@@ -22,15 +18,8 @@ module Staypuft
22
18
  end
23
19
 
24
20
  def controller_ip
25
- ip_for_controller(controllers.tap { |v| v.size == 1 or raise }.first)
21
+ controllers.tap { |v| v.size == 1 or raise }.first.ip
26
22
  end
27
23
 
28
- # TODO: a better fix is needed once we have explicit subnet support in staypuft
29
- # This is needed because host.ip doesn't always return the expected ip address
30
- # when the host has more than one network interface -- this ensures that the
31
- # provisioning network interface is the chosen one.
32
- def ip_for_controller(controller)
33
- Resolv::DNS.new(:nameserver => 'localhost').getaddress(controller.fqdn).to_s
34
- end
35
24
  end
36
25
  end
@@ -1,3 +1,3 @@
1
1
  module Staypuft
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: staypuft
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Staypuft team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-08 00:00:00.000000000 Z
11
+ date: 2014-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman-tasks