From 5bee775bc8d81469e0763c3125f75a2f24f46cbb Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Mon, 15 Dec 2014 23:22:36 -0500 Subject: [PATCH] Fix some issues with replacing hostname in xmpp config. --- actions/xmpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/actions/xmpp b/actions/xmpp index 2e2e7e6bb..c02203ded 100755 --- a/actions/xmpp +++ b/actions/xmpp @@ -82,7 +82,7 @@ def subcommand_change_hostname(arguments): with open(JWCHAT_CONFIG, 'w') as conffile: for line in lines: if re.match(r'\s*var\s+SITENAME', line): - conffile.write('var SITENAME = "' + new_hostname + '";') + conffile.write('var SITENAME = "' + new_hostname + '";\n') else: conffile.write(line) else: @@ -97,7 +97,8 @@ def subcommand_change_hostname(arguments): for line in lines: if in_hosts_section: if re.match(r'\s*-\s+"', line): - conffile.write(line.replace(old_hostname, new_hostname)) + conffile.write(line.replace('"' + old_hostname + '"', + '"' + new_hostname + '"')) else: in_hosts_section = False conffile.write(line)