Skip to content

Commit

Permalink
Revert "Merge pull request #175 from opscode/adamed-oc-9106"
Browse files Browse the repository at this point in the history
This reverts commit f1dd92a, reversing
changes made to dfe0051. This commit unintentionally pulled in changes from the master branch.
  • Loading branch information
adamedx committed Sep 23, 2013
1 parent f1dd92a commit 91edd2b
Show file tree
Hide file tree
Showing 99 changed files with 2,512 additions and 3,507 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source "https://rubygems.org"
source :rubygems

gemspec

Expand Down
136 changes: 0 additions & 136 deletions lib/ohai/dsl/plugin.rb

This file was deleted.

2 changes: 2 additions & 0 deletions lib/ohai/mixin/gce_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ module Ohai
module Mixin
module GCEMetadata

extend self

GCE_METADATA_ADDR = "metadata.google.internal" unless defined?(GCE_METADATA_ADDR)
GCE_METADATA_URL = "/0.1/meta-data" unless defined?(GCE_METADATA_URL)

Expand Down
48 changes: 0 additions & 48 deletions lib/ohai/mixin/seconds_to_human.rb

This file was deleted.

36 changes: 3 additions & 33 deletions lib/ohai/plugins/aix/cpu.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#
# Author:: Joshua Timberman <joshua@opscode.com>
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
# Copyright:: Copyright (c) 2013, Opscode, Inc.
# Author:: Doug MacEachern <dougm@vmware.com>
# Copyright:: Copyright (c) 2010 VMware, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -17,33 +16,4 @@
# limitations under the License.
#

provides "cpu"

cpu Mash.new

# IBM is the only maker of CPUs for AIX systems.
cpu[:vendor_id] = "IBM"
# At least one CPU will be available, but we'll wait to increment this later.
cpu[:available] = 0
cpu[:total] = 0

cpudevs = from("lsdev -Cc processor").lines
cpudevs.each do |c|
cpu[:total] += 1
name, status, location = c.split
cpu[name] = Mash.new
cpu[name][:status] = status
cpu[name][:location] = location
if status =~ /Available/
cpu[:available] += 1
lsattr = from("lsattr -El #{name}").lines
lsattr.each do |attribute|
attrib, value = attribute.split
cpu[name][attrib] = value
end
end
end

# Every AIX system has proc0.
cpu[:model] = cpu[:proc0][:type]
cpu[:mhz] = cpu[:proc0][:frequency].to_i / 1024
require_plugin "sigar::cpu"
60 changes: 3 additions & 57 deletions lib/ohai/plugins/aix/filesystem.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#
# Author:: Deepali Jagtap (<deepali.jagtap@clogeny.com>)
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
# Copyright:: Copyright (c) 2013 Opscode, Inc.
# Author:: Doug MacEachern <dougm@vmware.com>
# Copyright:: Copyright (c) 2010 VMware, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -17,57 +16,4 @@
# limitations under the License.
#

provides "filesystem"

fs = Mash.new

# Grab filesystem data from df
popen4("df -P") do |pid, stdin, stdout, stderr|
stdin.close
stdout.each do |line|
case line
when /^Filesystem\s+1024-blocks/
next
when /^(.+?)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+\%)\s+(.+)$/
filesystem = $1
fs[filesystem] = Mash.new
fs[filesystem][:kb_size] = $2
fs[filesystem][:kb_used] = $3
fs[filesystem][:kb_available] = $4
fs[filesystem][:percent_used] = $5
fs[filesystem][:mount] = $6
end
end
end

# Grab mount information from /bin/mount
popen4("mount") do |pid, stdin, stdout, stderr|
stdin.close
stdout.each do |line|
case line
when /^\s*node/
next
when /^\s*---/
next
when /^\s*\/\w/
fields = line.split
filesystem = fields[0]
fs[filesystem] = Mash.new unless fs.has_key?(filesystem)
fs[filesystem][:mount] = fields[1]
fs[filesystem][:fs_type] = fields[2]
#fs[filesystem][:mount_options] = fields[6]
fs[filesystem][:mount_options] = fields[6]
else
fields = line.split
filesystem = fields[0] + ":" + fields[1]
fs[filesystem] = Mash.new unless fs.has_key?(filesystem)
fs[filesystem][:mount] = fields[2]
fs[filesystem][:fs_type] = fields[3]
fs[filesystem][:mount_options] = fields[7]
end
end
end

# Set the filesystem data
filesystem fs

require_plugin "sigar::filesystem"
4 changes: 1 addition & 3 deletions lib/ohai/plugins/aix/hostname.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@
# limitations under the License.
#

provides "hostname"

hostname from("hostname")
require_plugin "sigar::hostname"
27 changes: 0 additions & 27 deletions lib/ohai/plugins/aix/kernel.rb

This file was deleted.

11 changes: 3 additions & 8 deletions lib/ohai/plugins/aix/memory.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Author:: Joshua Timberman <joshua@opscode.com>
# Copyright:: Copyright (c) 2013, Opscode, Inc.
# Author:: Doug MacEachern <dougm@vmware.com>
# Copyright:: Copyright (c) 2010 VMware, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,9 +16,4 @@
# limitations under the License.
#

provides "memory"

memory = Mash.new

meminfo = from("svmon -G -O unit=MB,summary=longreal | grep '[0-9]'")
memory[:total], u, memory[:free] = meminfo.split
require_plugin "sigar::memory"
Loading

0 comments on commit 91edd2b

Please sign in to comment.