Fix SLES platform detection

Surprisingly SUSE Linux Enterprise Server 12 SP2
returns 'SUSE Linux Enterprise Server ' as its
distribution identifier (note the trailing space).
This change is meant to fix it for now and ever.
Also fixed a misspelled log message.

Change-Id: I9ae02ee11ff28265a2a72754dd721f060f19b7ec
This commit is contained in:
Jakub Wachowski 2017-03-15 11:17:21 +01:00
parent c4d38ef4c5
commit 1bb63b85b1
1 changed files with 2 additions and 2 deletions

View File

@ -22,9 +22,9 @@ def detect_init(*args, **kwargs):
'centos linux', 'red hat enterprise linux server',
'suse linux enterprise server'
]
flavor = platform.linux_distribution()[0]
flavor = platform.linux_distribution()[0].strip()
if flavor.lower() not in supported_linux_flavors:
log.warn('{0} is not a support Linux distribution'.format(flavor))
log.warn('{0} is not a supported Linux distribution'.format(flavor))
return detect_linux_init(*args, **kwargs)
else:
print("{0} is not currently supported by the Monasca Agent".format(detected_os))