Skip to content

Commit

Permalink
orchestra/opsys.py: support openSUSE
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Cutler <ncutler@suse.com>
  • Loading branch information
smithfarm committed Jun 20, 2016
1 parent fa32cf4 commit 87caf37
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion teuthology/orchestra/opsys.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class OS(object):
__slots__ = ['name', 'version', 'codename', 'package_type']

_deb_distros = ('debian', 'ubuntu')
_rpm_distros = ('fedora', 'rhel', 'centos', 'suse')
_rpm_distros = ('fedora', 'rhel', 'centos', 'opensuse')

def __init__(self, name=None, version=None, codename=None):
self.name = name
Expand Down Expand Up @@ -99,6 +99,8 @@ def from_python(cls, python_val):
name = 'centos'
elif name.startswith('fedora'):
name = 'fedora'
elif name.startswith('opensuse'):
name = 'opensuse'
obj = cls(name=name, version=version, codename=codename.lower())
return obj

Expand All @@ -124,6 +126,8 @@ def from_lsb_release(cls, lsb_release_str):
name = cls._get_value(str_, 'Distributor ID')
if name == 'RedHatEnterpriseServer':
name = 'rhel'
elif name.startswith('openSUSE'):
name = 'opensuse'
name = name.lower()

version = cls._get_value(str_, 'Release')
Expand Down

0 comments on commit 87caf37

Please sign in to comment.