Merge distro name fix on oracle linux

This commit is contained in:
Yue Zhang
2015-03-26 21:51:15 +08:00
parent 0bf5284cd7
commit ab9ff1ce67
+7
View File
@@ -5620,6 +5620,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
@@ -5748,6 +5749,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 :