Introduce helper function get_distro() to identify the current Linux
distribution. Currently checks for 'Ubuntu' and 'Oracle Linux', which
are the only distros used for testing. Can be extended to support others
in the future.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
return result, cause
+# get the current linux flavour
+def get_distro(config):
+ with open('/etc/os-release', 'r') as relfile:
+ buf = relfile.read()
+ if "Oracle Linux" in buf:
+ return "oracle"
+ elif "Ubuntu" in buf:
+ return "ubuntu"
+
# vim: set et ts=4 sw=4: