summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-12-05 11:59:46 -0800
committerGitHub <noreply@github.com>2018-12-05 11:59:46 -0800
commit9a5cf1b81d37f97d7c075890886fc57cf5e45daa (patch)
treebcec4daba53e5d32c8e685a5630e61d2328f4166
parent04e4472fb6f3c3c462fc480e2e61bd8b4da3ae3f (diff)
parentb7095290fbf1e9cc17975299c775c43bc28c2ad4 (diff)
downloadohai-9a5cf1b81d37f97d7c075890886fc57cf5e45daa.tar.gz
Merge pull request #1330 from chef/xcp
Add support for XCP-NG platform
-rw-r--r--lib/ohai/plugins/linux/platform.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ohai/plugins/linux/platform.rb b/lib/ohai/plugins/linux/platform.rb
index 409f88ec..a8c8646e 100644
--- a/lib/ohai/plugins/linux/platform.rb
+++ b/lib/ohai/plugins/linux/platform.rb
@@ -127,7 +127,7 @@ Ohai.plugin(:Platform) do
when /debian/, /ubuntu/, /linuxmint/, /raspbian/, /cumulus/
# apt-get+dpkg almost certainly goes here
"debian"
- when /oracle/, /centos/, /redhat/, /scientific/, /enterpriseenterprise/, /xenserver/, /cloudlinux/, /ibm_powerkvm/, /parallels/, /nexus_centos/, /clearos/, /bigip/ # Note that 'enterpriseenterprise' is oracle's LSB "distributor ID"
+ when /oracle/, /centos/, /redhat/, /scientific/, /enterpriseenterprise/, /xcp/, /xenserver/, /cloudlinux/, /ibm_powerkvm/, /parallels/, /nexus_centos/, /clearos/, /bigip/ # Note that 'enterpriseenterprise' is oracle's LSB "distributor ID"
# NOTE: "rhel" should be reserved exclusively for recompiled rhel versions that are nearly perfectly compatible down to the platform_version.
# The operating systems that are "rhel" should all be as compatible as rhel7 = centos7 = oracle7 = scientific7 (98%-ish core RPM version compatibility
# and the version numbers MUST track the upstream). The appropriate EPEL version repo should work nearly perfectly. Some variation like the
@@ -285,6 +285,9 @@ Ohai.plugin(:Platform) do
elsif lsb[:id] =~ /XenServer/i
platform "xenserver"
platform_version lsb[:release]
+ elsif lsb[:id] =~ /XCP/i
+ platform "xcp"
+ platform_version lsb[:release]
elsif lsb[:id] # LSB can provide odd data that changes between releases, so we currently fall back on it rather than dealing with its subtleties
platform lsb[:id].downcase
platform_version lsb[:release]