ohai 0.6.8 → 0.6.10.rc.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -33,6 +33,9 @@ require_plugin 'linux::lsb'
33
33
  if lsb[:id] =~ /RedHat/i
34
34
  platform "redhat"
35
35
  platform_version lsb[:release]
36
+ elsif lsb[:id] =~ /Amazon/i
37
+ platform "amazon"
38
+ platform_version lsb[:release]
36
39
  elsif lsb[:id]
37
40
  platform lsb[:id].downcase
38
41
  platform_version lsb[:release]
@@ -36,7 +36,10 @@ def find_ip_and_mac(addresses)
36
36
  [ip, mac]
37
37
  end
38
38
 
39
- if network[:default_interface]
39
+ # If we have a default interface that has addresses, populate the short-cut attributes
40
+ if network[:default_interface] and
41
+ network["interfaces"][network[:default_interface]] and
42
+ network["interfaces"][network[:default_interface]]["addresses"]
40
43
  Ohai::Log.debug("Using default interface for default ip and mac address")
41
44
  im = find_ip_and_mac(network["interfaces"][network[:default_interface]]["addresses"])
42
45
  ipaddress im.shift
@@ -18,6 +18,8 @@
18
18
 
19
19
  require 'ruby-wmi'
20
20
 
21
+ WIN32OLE.codepage = WIN32OLE::CP_UTF8
22
+
21
23
  def machine_lookup(sys_type)
22
24
  return "i386" if sys_type.eql?("X86-based PC")
23
25
  return "x86_64" if sys_type.eql?("x64-based PC")
@@ -18,6 +18,6 @@
18
18
 
19
19
  module Ohai
20
20
  OHAI_ROOT = File.expand_path(File.dirname(__FILE__))
21
- VERSION = '0.6.8'
21
+ VERSION = '0.6.10.rc.1'
22
22
  end
23
23
 
@@ -56,6 +56,20 @@ describe Ohai::System, "Linux plugin platform" do
56
56
  @ohai._require_plugin("linux::platform")
57
57
  @ohai[:platform_version].should == "8.04"
58
58
  end
59
+
60
+ it "should set platform to redhat when [:lsb][:id] contains Redhat" do
61
+ @ohai[:lsb][:id] = "RedHatEnterpriseServer"
62
+ @ohai[:lsb][:release] = "5.7"
63
+ @ohai._require_plugin("linux::platform")
64
+ @ohai[:platform].should == "redhat"
65
+ end
66
+
67
+ it "should set platform to amazon when [:lsb][:id] contains Amazon" do
68
+ @ohai[:lsb][:id] = "AmazonAMI"
69
+ @ohai[:lsb][:release] = "2011.09"
70
+ @ohai._require_plugin("linux::platform")
71
+ @ohai[:platform].should == "amazon"
72
+ end
59
73
  end
60
74
 
61
75
  describe "on debian" do
metadata CHANGED
@@ -1,13 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohai
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease:
4
+ hash: 15424039
5
+ prerelease: 7
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 8
10
- version: 0.6.8
9
+ - 10
10
+ - rc
11
+ - 1
12
+ version: 0.6.10.rc.1
11
13
  platform: ruby
12
14
  authors:
13
15
  - Adam Jacob
@@ -15,7 +17,7 @@ autorequire:
15
17
  bindir: bin
16
18
  cert_chain: []
17
19
 
18
- date: 2011-10-05 00:00:00 Z
20
+ date: 2011-10-21 00:00:00 Z
19
21
  dependencies:
20
22
  - !ruby/object:Gem::Dependency
21
23
  name: yajl-ruby
@@ -37,12 +39,14 @@ dependencies:
37
39
  requirement: &id002 !ruby/object:Gem::Requirement
38
40
  none: false
39
41
  requirements:
40
- - - ">="
42
+ - - ~>
41
43
  - !ruby/object:Gem::Version
42
- hash: 3
44
+ hash: 7
43
45
  segments:
46
+ - 2
47
+ - 2
44
48
  - 0
45
- version: "0"
49
+ version: 2.2.0
46
50
  type: :runtime
47
51
  version_requirements: *id002
48
52
  - !ruby/object:Gem::Dependency
@@ -375,12 +379,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
375
379
  required_rubygems_version: !ruby/object:Gem::Requirement
376
380
  none: false
377
381
  requirements:
378
- - - ">="
382
+ - - ">"
379
383
  - !ruby/object:Gem::Version
380
- hash: 3
384
+ hash: 25
381
385
  segments:
382
- - 0
383
- version: "0"
386
+ - 1
387
+ - 3
388
+ - 1
389
+ version: 1.3.1
384
390
  requirements: []
385
391
 
386
392
  rubyforge_project: