From e91c318327349a08b5ab468f266dc2e8e1918daa Mon Sep 17 00:00:00 2001 From: Robin Roth Date: Mon, 28 Jul 2014 15:22:10 +0200 Subject: [PATCH] Fix extra newline at end of hostname for Fedora This fixes a bug introduced by 138b45e3. The hostname has an additional newline at the end which leads to the state always being 'changed: true' even if the hostname is unchanged. --- library/system/hostname | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/system/hostname b/library/system/hostname index e2b7572eef5..3a8bc56bd72 100755 --- a/library/system/hostname +++ b/library/system/hostname @@ -259,7 +259,7 @@ class FedoraStrategy(GenericStrategy): if rc != 0: self.module.fail_json(msg="Command failed rc=%d, out=%s, err=%s" % (rc, out, err)) - return out + return out.strip() def set_permanent_hostname(self, name): cmd = ['hostnamectl', '--pretty', 'set-hostname', name]