Issue #77: fix - Remove spurrious spaces.
authorSteven Black <redacted>
Mon, 15 Feb 2016 17:29:02 +0000 (12:29 -0500)
committerSteven Black <redacted>
Mon, 15 Feb 2016 17:29:02 +0000 (12:29 -0500)
updateHostsFile.py

index b65eb31f8c793284c8c675da18ad275dead4ace1..358eda58cbef15036b85b64052c7628bf56c3931 100644 (file)
@@ -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)
git clone https://git.99rst.org/PROJECT