Commit af1eb5d0 authored by Shane Kerr's avatar Shane Kerr
Browse files

Fix a big which prevented the '--address' option from working.

Also cleaned up a bit of the parameter parsing and such.

See Trac ticket 442 for more details:

https://bind10.isc.org/ticket/442


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@3934 e5f2f494-b856-4b98-b285-d166d9295462
parent 74b6f51a
......@@ -206,12 +206,11 @@ class BoB:
"""
self.address = address
self.dns_port = dns_port
self.forward = None
self.recursive = False
self.forward = forward
if forward:
self.forward = forward
self.recursive = True
self.nocache = False
else:
self.recursive = False
self.cc_session = None
self.ccs = None
self.cfg_start_auth = True
......@@ -740,7 +739,7 @@ def check_addr(option, opt_str, value, parser):
try:
if opt_str in ['-a', '--address']:
parser.values.address = isc.net.parse.addr_parse(value)
if opt_str in ['-f', '--forward']:
elif opt_str in ['-f', '--forward']:
parser.values.forward = isc.net.parse.addr_parse(value)
else:
raise OptionValueError("Unknown option " + opt_str)
......@@ -763,7 +762,7 @@ def main():
action="callback", callback=check_addr, default=None,
help="address the DNS server will use (default: listen on all addresses)")
parser.add_option("-f", "--forward", dest="forward", type="string",
action="callback", callback=check_addr, default='',
action="callback", callback=check_addr, default=None,
help="nameserver to which DNS queries should be forwarded")
parser.add_option("-m", "--msgq-socket-file", dest="msgq_socket_file",
type="string", default=None,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment