Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inventory host serial number #139

Merged
merged 1 commit into from
Nov 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ def self.host_inv_to_os_hash(inv, hostname)
end

def self.host_inv_to_hardware_hash(inv)
hardware_serial = inv.fetch_path('hardware', 'systemInfo', 'uuid')
console = inv.fetch_path('config', 'consoleReservation')
inv = inv['summary']
return nil if inv.nil?
Expand All @@ -397,6 +398,7 @@ def self.host_inv_to_hardware_hash(inv)
result[:cpu_total_cores] = hdw["numCpuCores"] unless hdw["numCpuCores"].blank?
# Calculate the number of cores per socket by dividing total numCpuCores by numCpuPkgs
result[:cpu_cores_per_socket] = (result[:cpu_total_cores].to_f / result[:cpu_sockets].to_f).to_i unless hdw["numCpuCores"].blank? || hdw["numCpuPkgs"].blank?
result[:serial_number] = hardware_serial
end

config = inv["config"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ module ManageIQ::Providers::Vmware::InfraManager::SelectorSpec
"datastore.ManagedObjectReference",
"hardware.systemInfo.otherIdentifyingInfo[*].identifierValue",
"hardware.systemInfo.otherIdentifyingInfo[*].identifierType.key",
"hardware.systemInfo.uuid",
"name",
"summary.config.name",
"summary.config.product.build",
Expand Down
2 changes: 1 addition & 1 deletion manageiq-providers-vmware.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.files = Dir["{app,config,lib}/**/*"]

s.add_dependency("fog-vcloud-director", ["~> 0.1.8"])
s.add_dependency "vmware_web_service", "~>0.2.0"
s.add_dependency "vmware_web_service", "~>0.2.3"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agrare here you go....

s.add_dependency "rbvmomi", "~>1.11.3"

s.add_development_dependency "codeclimate-test-reporter", "~> 1.0.0"
Expand Down