Skip to content
Permalink
Browse files

send only the number of CPU sockets

the other values are not important for SCC
  • Loading branch information...
lslezak committed Jan 15, 2014
1 parent c349a7b commit 2079d0a1865f94a622e4147d82d5899c1c0f85ec
Showing with 10 additions and 3 deletions.
  1. +1 −1 src/lib/registration/scc_client.rb
  2. +9 −2 src/lib/registration/scc_hw_detection.rb
@@ -66,7 +66,7 @@ def announce_handler(location = nil, redirects = MAX_REDIRECTS)
"hostname" => Socket.gethostname,
"hwinfo" => {
# TODO FIXME: check the expected structure
"sockets" => SccHwDetection.cpu_info,
"sockets" => SccHwDetection.cpu_sockets,
"graphics" => SccHwDetection.gfx_vendor
}
}.to_json
@@ -15,11 +15,18 @@ class SccHwDetection
0x8086 => "intel"
}

def self.cpu_info
def self.cpu_sockets
lc_all_bak = ENV["LC_ALL"]
# run "lscpu" in "C" locale to suppress translations
ENV["LC_ALL"] = "C"
return `lscpu`
ret = `lscpu`

if ret.match /^Socket\(s\):\s*(\d+)\s*$/
Builtins.y2milestone("Detected CPU sockets: #{$1}")
return $1.to_i
else
raise "CPU detection failed"
end
ensure
ENV["LC_ALL"] = lc_all_bak
end

0 comments on commit 2079d0a

Please sign in to comment.
You can’t perform that action at this time.