Skip to content

Commit

Permalink
Fix extra newline at end of hostname for Fedora
Browse files Browse the repository at this point in the history
This fixes a bug introduced by 138b45e.
The hostname has an additional newline at the end which leads to the
state always being 'changed: true' even if the hostname is unchanged.
  • Loading branch information
Robin Roth committed Jul 28, 2014
1 parent d51e10a commit e91c318
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/system/hostname
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit e91c318

Please sign in to comment.