svenvogel commented on a change in pull request #2896: add exitcode /
distribution detection and remove export CGROUP_DAEMON for RHEL7/CentOS7
URL: https://github.com/apache/cloudstack/pull/2896#discussion_r228497076
##########
File path: python/lib/cloudutils/serviceConfig.py
##########
@@ -23,6 +23,29 @@
import os
import shutil
+# exit() error constants
+Unknown = 0
+CentOS6 = 1
+CentOS7 = 2
+Ubuntu = 3
+RHEL6 = 4
+RHEL7 = 5
+
+#=================== DISTRIBUTION DETECTION =================
+if os.path.exists("/etc/redhat-release"):
+ version = file("/etc/redhat-release").readline()
+ if version.find("Red Hat Enterprise Linux Server release 6") != -1:
+ distro = RHEL6
+ elif version.find("Red Hat Enterprise Linux Server 7") != -1:
+ distro = RHEL7
+ elif version.find("CentOS release 6") != -1:
+ distro = CentOS6
+ elif version.find("CentOS Linux release 7") != -1:
+ distro = CentOS7
+elif os.path.exists("/etc/legal") and "Ubuntu" in file("/etc/legal").read(-1):
distro = Ubuntu
Review comment:
Hi @rhtyd
yes we can change it... i can change it oaky?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services