Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
def _normalized_distro_name(distro):
distro = distro.lower()
- if distro.startswith('redhat'):
+ if distro.startswith(('redhat', 'red hat')):
return 'redhat'
elif distro.startswith('suse'):
return 'suse'
result = hosts._get_distro('RedHat')
assert result.__name__.endswith('centos')
+ def test_get_redhat_whitespace(self):
+ result = hosts._get_distro('Red Hat Enterprise Linux')
+ assert result.__name__.endswith('centos')
+
def test_get_uknown(self):
with raises(exc.UnsupportedPlatform):
hosts._get_distro('Solaris')