2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-29 13:07:50 +00:00

add an isc_config.py 'module' for paths and possibly other configure-time variables (currently only BIND10_MSGQ_SOCKET_FILE, and currently only used in lib/python/isc/cc/session.py)

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac223@2049 e5f2f494-b856-4b98-b285-d166d9295462
This commit is contained in:
Jelte Jansen 2010-06-02 11:53:23 +00:00
parent 15252706b8
commit ae076ba6fb
11 changed files with 11 additions and 17 deletions

View File

@ -448,7 +448,7 @@ AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
src/lib/python/isc/config/tests/config_test src/lib/python/isc/config/tests/config_test
src/lib/python/isc/cc/tests/cc_test src/lib/python/isc/cc/tests/cc_test
src/lib/dns/gen-rdatacode.py src/lib/dns/gen-rdatacode.py
src/lib/python/isc/cc/session.py src/lib/python/isc_config.py
src/lib/dns/tests/testdata/gen-wiredata.py src/lib/dns/tests/testdata/gen-wiredata.py
src/lib/cc/session_config.h.pre src/lib/cc/session_config.h.pre
], [ ], [

View File

@ -7,6 +7,6 @@ PYCOVERAGE = $(PYTHON)
check-local: check-local:
for pytest in $(PYTESTS) ; do \ for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \ echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/bin/bind10 \ env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/bin/bind10 \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \ $(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
done done

View File

@ -7,6 +7,6 @@ PYCOVERAGE = $(PYTHON)
check-local: check-local:
for pytest in $(PYTESTS) ; do \ for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \ echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_srcdir)/src/bin \ env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_srcdir)/src/bin \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \ $(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
done done

View File

@ -7,6 +7,6 @@ PYCOVERAGE = $(PYTHON)
check-local: check-local:
for pytest in $(PYTESTS) ; do \ for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \ echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/bin/cmdctl \ env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/bin/cmdctl \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \ $(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
done done

View File

@ -144,9 +144,7 @@ class MsgQ:
if os.path.exists(self.socket_file): if os.path.exists(self.socket_file):
os.remove(self.socket_file) os.remove(self.socket_file)
try: try:
print("[XX] SOCKET FILE: " + self.socket_file)
self.listen_socket.bind(self.socket_file) self.listen_socket.bind(self.socket_file)
print("[XX] LISTENING ON SOCKET FILE: " + self.socket_file)
self.listen_socket.listen(1024) self.listen_socket.listen(1024)
except Exception as e: except Exception as e:
# remove the file again if something goes wrong # remove the file again if something goes wrong

View File

@ -7,7 +7,7 @@ PYCOVERAGE = $(PYTHON)
check-local: check-local:
for pytest in $(PYTESTS) ; do \ for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \ echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_builddir)/src/bin/msgq:$(abs_top_srcdir)/src/lib/python \ env PYTHONPATH=$(abs_top_builddir)/src/bin/msgq:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \ $(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
done done

View File

@ -9,7 +9,7 @@ PYCOVERAGE = $(PYTHON)
check-local: check-local:
for pytest in $(PYTESTS) ; do \ for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \ echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/bin/xfrin:$(abs_top_srcdir)/src/lib/python \ env PYTHONPATH=$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/bin/xfrin:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \ $(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
done done

View File

@ -9,7 +9,7 @@ PYCOVERAGE = $(PYTHON)
check-local: check-local:
for pytest in $(PYTESTS) ; do \ for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \ echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_builddir)/src/bin/xfrout:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/lib/xfr/.libs \ env PYTHONPATH=$(abs_top_builddir)/src/bin/xfrout:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/lib/xfr/.libs \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \ $(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
done done

View File

@ -18,6 +18,7 @@ import socket
import struct import struct
import os import os
import threading import threading
import isc_config
import isc.cc.message import isc.cc.message
@ -26,11 +27,6 @@ class NetworkError(Exception): pass
class SessionError(Exception): pass class SessionError(Exception): pass
class Session: class Session:
SOCKET_FILE = os.path.join("@localstatedir@",
"@PACKAGE_NAME@",
"msgq_socket").replace("${prefix}",
"@prefix@")
def __init__(self, socket_file=None): def __init__(self, socket_file=None):
self._socket = None self._socket = None
self._lname = None self._lname = None
@ -45,7 +41,7 @@ class Session:
if "BIND10_MSGQ_SOCKET_FILE" in os.environ: if "BIND10_MSGQ_SOCKET_FILE" in os.environ:
self.socket_file = os.environ["BIND10_MSGQ_SOCKET_FILE"] self.socket_file = os.environ["BIND10_MSGQ_SOCKET_FILE"]
else: else:
self.socket_file = self.SOCKET_FILE self.socket_file = isc_config.BIND10_MSGQ_SOCKET_FILE
else: else:
self.socket_file = socket_file self.socket_file = socket_file

View File

@ -10,6 +10,6 @@ PYCOVERAGE = $(PYTHON)
check-local: check-local:
for pytest in $(PYTESTS) ; do \ for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \ echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python \ env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \ $(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
done done

View File

@ -9,7 +9,7 @@ PYCOVERAGE = $(PYTHON)
check-local: check-local:
for pytest in $(PYTESTS) ; do \ for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \ echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python \ env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python \
CONFIG_TESTDATA_PATH=$(abs_top_srcdir)/src/lib/config/testdata \ CONFIG_TESTDATA_PATH=$(abs_top_srcdir)/src/lib/config/testdata \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \ $(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
done done