From 1bb63b85b157c311f32af2b2c3b17bcbcfcb5352 Mon Sep 17 00:00:00 2001 From: Jakub Wachowski Date: Wed, 15 Mar 2017 11:17:21 +0100 Subject: [PATCH] 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 --- monasca_setup/service/detection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monasca_setup/service/detection.py b/monasca_setup/service/detection.py index 4c7b92a2..2cd28bcf 100644 --- a/monasca_setup/service/detection.py +++ b/monasca_setup/service/detection.py @@ -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))