diff --git a/system/hostname b/system/hostname index 9836b98c71f..826e0f630d2 100644 --- a/system/hostname +++ b/system/hostname @@ -58,8 +58,10 @@ class UnimplementedStrategy(object): def unimplemented_error(self): platform = get_platform() distribution = get_distribution() - msg_platform = '%s (%s)' % (platform, distribution) \ - if distribution is not None else platform + if distribution is not None: + msg_platform = '%s (%s)' % (platform, distribution) + else: + msg_platform = platform self.module.fail_json( msg='hostname module cannot be used on platform %s' % msg_platform)