WALinuxAgent/WALinuxAgent-2.0.12-oracle-linux-name.patch
2015-04-02 01:19:36 -07:00

35 lines
1.2 KiB
Diff

From 95d1985deca1bc2561031ef08cc300b29558269c Mon Sep 17 00:00:00 2001
From: Yue Zhang <yuezha@microsoft.com>
Date: Thu, 26 Mar 2015 21:51:15 +0800
Subject: [PATCH] Merge distro name fix on oracle linux
---
waagent | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/waagent b/waagent
index cbd005b..68d3c64 100644
--- a/waagent
+++ b/waagent
@@ -5619,6 +5619,7 @@ def DistInfo(fullname=0):
release = re.sub('\-.*\Z', '', str(platform.release()))
distinfo = ['FreeBSD', release]
return distinfo
+
if 'linux_distribution' in dir(platform):
distinfo = list(platform.linux_distribution(full_distribution_name=fullname))
distinfo[0] = distinfo[0].strip() # remove trailing whitespace in distro name
@@ -5747,6 +5748,12 @@ def main():
LoggerInit('/var/log/waagent.log','/dev/console')
global LinuxDistro
LinuxDistro=DistInfo()[0]
+
+ #The platform.py lib has issue with detecting oracle linux distribution.
+ #Merge the following patch provided by oracle as a temparory fix.
+ if os.path.exists("/etc/oracle-release"):
+ LinuxDistro="Oracle Linux"
+
global MyDistro
MyDistro=GetMyDistro()
if MyDistro == None :