This patch try to add get_os_vendor function to autotest_utils.py,
to guess what os vendor of the client test box.
From: walkinair@cn.ibm.com
git-svn-id: http://test.kernel.org/svn/autotest/trunk@256 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/bin/autotest_utils.py b/bin/autotest_utils.py
index 46b181e..629d0bb 100755
--- a/bin/autotest_utils.py
+++ b/bin/autotest_utils.py
@@ -160,6 +160,25 @@
return 1
return 0
+def get_os_vendor():
+ """Try to guess what's the os vendor
+ """
+ issue = '/etc/issue'
+
+ if not os.path.isfile(issue):
+ return 'Unknown'
+
+ if file_contains_pattern(issue, 'Red Hat'):
+ return 'Red Hat'
+ elif file_contains_pattern(issue, 'Fedora Core'):
+ return 'Fedora Core'
+ elif file_contains_pattern(issue, 'SUSE'):
+ return 'SUSE'
+ elif file_contains_pattern(issue, 'Ubuntu'):
+ return 'Ubuntu'
+ else:
+ return 'Unknown'
+
def get_vmlinux():
"""Return the full path to vmlinux