From: Steven Black Date: Mon, 15 Feb 2016 17:29:02 +0000 (-0500) Subject: Issue #77: fix - Remove spurrious spaces. X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=d69aa1add3e9715a15fd39c74e20e76ff216d8aa;p=stevenblack-hosts.git Issue #77: fix - Remove spurrious spaces. --- diff --git a/updateHostsFile.py b/updateHostsFile.py index b65eb31f8..358eda58c 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -282,7 +282,7 @@ def normalizeRule(rule): result = re.search(r'^[ \t]*(\d+\.\d+\.\d+\.\d+)\s+([\w\.-]+)(.*)', rule) if result: hostname, suffix = result.group(2,3) - hostname = hostname.lower() # explicitly lowercase hostname + hostname = hostname.lower().strip() # explicitly lowercase and trim the hostname if suffix is not '': # add suffix as comment only, not as a separate host return hostname, "%s %s #%s\n" % (TARGET_HOST, hostname, suffix)