From 83be006e288c58a46f5b76c29b6886c1f417d88c Mon Sep 17 00:00:00 2001 From: Ɓukasz 'sil2100' Zemczak Date: Wed, 15 Mar 2017 10:19:34 +0100 Subject: Import patches-unapplied version 2.2.6-0ubuntu1 to ubuntu/zesty-proposed Imported using git-ubuntu import. Changelog parent: d064ab0bffd429382ea4fafeb144784d403848bd New changelog entries: * New upstream release (LP: #1661750). * debian/control: - Change the maintainer to Ubuntu Developers (LP: #1657528). - Add the dependency of isc-dhcp-client as our maintainer scripts assume it's installed. - Add trailing commas to dependencies, add whitespaces. * Rename ephemeral-disk-warning.sh to ephemeral-disk-warning (lintian error). * debian/docs: - Remove LICENSE.txt as it's redundant. * debian/postinst: - Stop checking for update-initramfs existence using the absolute path, use the 'command' command instead to make lintian happy. * Remove debian/patches/disable-auto-update.patch: - We now ship with auto-updates enabled (LP: #1650522). * debian/maintscript: - Add a maintscript to rename the old logrotate file on upgrade from an ancient version of walinuxagent (LP: #1673152). --- azurelinuxagent/common/osutil/factory.py | 51 +++++++++++++++++++------------- 1 file changed, 30 insertions(+), 21 deletions(-) (limited to 'azurelinuxagent/common/osutil/factory.py') diff --git a/azurelinuxagent/common/osutil/factory.py b/azurelinuxagent/common/osutil/factory.py index 2718ba1..acd7f6e 100644 --- a/azurelinuxagent/common/osutil/factory.py +++ b/azurelinuxagent/common/osutil/factory.py @@ -17,9 +17,7 @@ import azurelinuxagent.common.logger as logger from azurelinuxagent.common.utils.textutil import Version -from azurelinuxagent.common.version import DISTRO_NAME, DISTRO_VERSION, \ - DISTRO_FULL_NAME - +from azurelinuxagent.common.version import * from .default import DefaultOSUtil from .clearlinux import ClearLinuxUtil from .coreos import CoreOSUtil @@ -27,54 +25,65 @@ from .debian import DebianOSUtil from .freebsd import FreeBSDOSUtil from .redhat import RedhatOSUtil, Redhat6xOSUtil from .suse import SUSEOSUtil, SUSE11OSUtil -from .ubuntu import UbuntuOSUtil, Ubuntu12OSUtil, Ubuntu14OSUtil, \ - UbuntuSnappyOSUtil +from .ubuntu import UbuntuOSUtil, Ubuntu12OSUtil, Ubuntu14OSUtil, UbuntuSnappyOSUtil from .alpine import AlpineOSUtil from .bigip import BigIpOSUtil -def get_osutil(distro_name=DISTRO_NAME, distro_version=DISTRO_VERSION, + +def get_osutil(distro_name=DISTRO_NAME, + distro_code_name=DISTRO_CODE_NAME, + distro_version=DISTRO_VERSION, distro_full_name=DISTRO_FULL_NAME): + if distro_name == "clear linux software for intel architecture": return ClearLinuxUtil() + if distro_name == "ubuntu": - if Version(distro_version) == Version("12.04") or \ - Version(distro_version) == Version("12.10"): + if Version(distro_version) == Version("12.04") or Version(distro_version) == Version("12.10"): return Ubuntu12OSUtil() - elif Version(distro_version) == Version("14.04") or \ - Version(distro_version) == Version("14.10"): + elif Version(distro_version) == Version("14.04") or Version(distro_version) == Version("14.10"): return Ubuntu14OSUtil() elif distro_full_name == "Snappy Ubuntu Core": return UbuntuSnappyOSUtil() else: return UbuntuOSUtil() + if distro_name == "alpine": return AlpineOSUtil() + if distro_name == "kali": - return DebianOSUtil() - if distro_name == "coreos": + return DebianOSUtil() + + if distro_name == "coreos" or distro_code_name == "coreos": return CoreOSUtil() + if distro_name == "suse": - if distro_full_name=='SUSE Linux Enterprise Server' and \ - Version(distro_version) < Version('12') or \ - distro_full_name == 'openSUSE' and \ - Version(distro_version) < Version('13.2'): + if distro_full_name == 'SUSE Linux Enterprise Server' \ + and Version(distro_version) < Version('12') \ + or distro_full_name == 'openSUSE' and Version(distro_version) < Version('13.2'): return SUSE11OSUtil() else: return SUSEOSUtil() + elif distro_name == "debian": return DebianOSUtil() - elif distro_name == "redhat" or distro_name == "centos" or \ - distro_name == "oracle": + + elif distro_name == "redhat" \ + or distro_name == "centos" \ + or distro_name == "oracle": if Version(distro_version) < Version("7"): return Redhat6xOSUtil() else: return RedhatOSUtil() + elif distro_name == "freebsd": return FreeBSDOSUtil() + elif distro_name == "bigip": return BigIpOSUtil() + else: - logger.warn("Unable to load distro implementation for {0}.", distro_name) - logger.warn("Use default distro implementation instead.") + logger.warn("Unable to load distro implementation for {0}. Using " + "default distro implementation instead.", + distro_name) return DefaultOSUtil() - -- cgit v1.2.3