[svn] commit: r1554 - in /trunk/src: bin/bind10/bind10.py.in bin/msgq/msgq.py.in lib/python/isc/cc/session.py
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Mar 18 23:10:37 UTC 2010
Author: mgraff
Date: Thu Mar 18 23:10:36 2010
New Revision: 1554
Log:
closer to goodness: undoing default port numbers set in __init__() methods and elsewhere
Modified:
trunk/src/bin/bind10/bind10.py.in
trunk/src/bin/msgq/msgq.py.in
trunk/src/lib/python/isc/cc/session.py
Modified: trunk/src/bin/bind10/bind10.py.in
==============================================================================
--- trunk/src/bin/bind10/bind10.py.in (original)
+++ trunk/src/bin/bind10/bind10.py.in Thu Mar 18 23:10:36 2010
@@ -118,7 +118,6 @@
spawn_env['PYTHON_EXEC'] = os.environ['PYTHON_EXEC']
if 'PYTHONPATH' in os.environ:
spawn_env['PYTHONPATH'] = os.environ['PYTHONPATH']
- spawn_env['ISC_MSGQ_PORT'] = self.c_channel_port
self.process = subprocess.Popen(self.args,
stdin=subprocess.PIPE,
stdout=spawn_stdout,
@@ -216,7 +215,7 @@
sys.stdout.write("Starting msgq using port %d\n" %
self.c_channel_port)
try:
- c_channel = ProcessInfo("msgq", "msgq", c_channel_env, True)
+ c_channel = ProcessInfo("msgq", ["msgq"], c_channel_env, True)
except Exception as e:
return "Unable to start msgq; " + str(e)
self.processes[c_channel.pid] = c_channel
@@ -241,7 +240,8 @@
if self.verbose:
sys.stdout.write("Starting b10-cfgmgr\n")
try:
- bind_cfgd = ProcessInfo("b10-cfgmgr", "b10-cfgmgr")
+ bind_cfgd = ProcessInfo("b10-cfgmgr", ["b10-cfgmgr"],
+ { 'ISC_MSGQ_PORT': str(self.c_channel_port)})
except Exception as e:
c_channel.process.kill()
return "Unable to start b10-cfgmgr; " + str(e)
@@ -269,7 +269,8 @@
self.auth_port)
authargs += ['-v']
try:
- auth = ProcessInfo("b10-auth", authargs)
+ auth = ProcessInfo("b10-auth", authargs,
+ { 'ISC_MSGQ_PORT': str(self.c_channel_port)})
except Exception as e:
c_channel.process.kill()
bind_cfgd.process.kill()
@@ -282,7 +283,8 @@
if self.verbose:
sys.stdout.write("Starting b10-xfrin\n")
try:
- xfrind = ProcessInfo("b10-xfrin", ['b10-xfrin'])
+ xfrind = ProcessInfo("b10-xfrin", ['b10-xfrin'],
+ { 'ISC_MSGQ_PORT': str(self.c_channel_port)})
except Exception as e:
c_channel.process.kill()
bind_cfgd.process.kill()
@@ -297,7 +299,8 @@
if self.verbose:
sys.stdout.write("Starting b10-cmdctl on port 8080\n")
try:
- cmd_ctrld = ProcessInfo("b10-cmdctl", ['b10-cmdctl'])
+ cmd_ctrld = ProcessInfo("b10-cmdctl", ['b10-cmdctl'],
+ { 'ISC_MSGQ_PORT': str(self.c_channel_port)})
except Exception as e:
c_channel.process.kill()
bind_cfgd.process.kill()
Modified: trunk/src/bin/msgq/msgq.py.in
==============================================================================
--- trunk/src/bin/msgq/msgq.py.in (original)
+++ trunk/src/bin/msgq/msgq.py.in Thu Mar 18 23:10:36 2010
@@ -71,15 +71,25 @@
class MsgQ:
"""Message Queue class."""
- def __init__(self, c_channel_port=9912, verbose=False):
+ def __init__(self, port=0, verbose=False):
"""Initialize the MsgQ master.
- The c_channel_port specifies the TCP/IP port that the msgq
+ The port specifies the TCP/IP port that the msgq
process listens on. If verbose is True, then the MsgQ reports
what it is doing.
"""
+
+ if port == 0:
+ if 'ISC_MSGQ_PORT' in os.environ:
+ port = int(os.environ["ISC_MSGQ_PORT"])
+ else:
+ port = 9912
+
+
+ print(port)
+
self.verbose = verbose
- self.c_channel_port = c_channel_port
+ self.c_channel_port = port
self.poller = None
self.kqueue = None
self.runnable = False
@@ -365,7 +375,7 @@
parser.add_option("-v", "--verbose", dest="verbose", action="store_true",
help="display more about what is going on")
parser.add_option("-m", "--msgq-port", dest="msgq_port", type="string",
- action="callback", callback=check_port, default="9912",
+ action="callback", callback=check_port, default="0",
help="port the msgq daemon will use")
(options, args) = parser.parse_args()
Modified: trunk/src/lib/python/isc/cc/session.py
==============================================================================
--- trunk/src/lib/python/isc/cc/session.py (original)
+++ trunk/src/lib/python/isc/cc/session.py Thu Mar 18 23:10:36 2010
@@ -35,7 +35,7 @@
self._queue = []
if port == 0:
- if 'B10_FROM_SOURCE' in os.environ:
+ if 'ISC_MSGQ_PORT' in os.environ:
port = int(os.environ["ISC_MSGQ_PORT"])
else:
port = 9912
More information about the bind10-changes
mailing list