Fix distro detection on latest opensuse leap release
on opensuse-leap 15.0, the value of distro.id() is reported
as "opensuse-leap", which breaks previous detection relying on
the string exactly equal to "opensuse". The zypper detection
now works for opensuse leap, SLES and opensuse-tumbleweed
@@ -122,8 +122,11 @@ class OSInfo(object):
@property
def with_zypper(self):
- return self.is_linux and self.linux_distro in \
- ("opensuse", "sles")
+ if not self.is_linux:
+ return False
+ if "opensuse" in self.linux_distro or "sles" in self.linux_distro:
+ return True
+ return False
@staticmethod
def get_win_os_version():
