Explicitly lowercase hostname to prevent mixed-case duplicates.
authorqqo <redacted>
Fri, 23 Oct 2015 21:58:12 +0000 (00:58 +0300)
committerqqo <redacted>
Fri, 23 Oct 2015 21:58:12 +0000 (00:58 +0300)
updateHostsFile.py

index e153d71b6029f32a0ab7fef14e6fd475480c6094..2108a4f783ce0a4eb42940fbf9dfca86ceda31a1 100755 (executable)
@@ -188,6 +188,7 @@ def normalizeRule(rule):
        result = re.search(r'^[ \t]*(\d+\.\d+\.\d+\.\d+)\s+([\w\.-]+)(.*)',rule)
        if result:
                target, hostname, suffix = result.groups()
+               hostname = hostname.lower() # explicitly lowercase hostname
                return hostname, "%s %s %s\n" % (TARGET_HOST, hostname, suffix)
        print '==>%s<==' % rule
        return None, None
git clone https://git.99rst.org/PROJECT