Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make-lighttpd-proxyconf.py parses comments #14

Closed
jsurratt opened this issue Jul 6, 2009 · 0 comments
Closed

make-lighttpd-proxyconf.py parses comments #14

jsurratt opened this issue Jul 6, 2009 · 0 comments
Labels

Comments

@jsurratt
Copy link

jsurratt commented Jul 6, 2009

We have commented out lines of host names and IPs in our /etc/hosts that we'd rather not remove at this time. However, make-lighttpd-proxyconf.py still parses those old and invalid lines. Modifying the script to the code below fixes the problem.

Thanks!

    #!/usr/bin/python
    import os, re

    port = os.environ["DISCO_PORT"]
    print "proxy.server = ("
    r = re.compile("^(\d+\.\d+\.\d+\.\d+)\s+(.*)", re.MULTILINE)
    for x in re.finditer(r, file("/etc/hosts").read()):
            ip, host = x.groups()
            print '"/disco/node/%s/" => (("host" => "%s", "port" => %s)),' %\
                    (host, ip, port)
    print ")"
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant