Browse Source

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
Jelte Jansen 15 years ago
parent
commit
ae076ba6fb

+ 1 - 1
configure.ac

@@ -448,7 +448,7 @@ AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
            src/lib/python/isc/config/tests/config_test
            src/lib/python/isc/cc/tests/cc_test
            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/cc/session_config.h.pre
           ], [

+ 1 - 1
src/bin/bind10/tests/Makefile.am

@@ -7,6 +7,6 @@ PYCOVERAGE = $(PYTHON)
 check-local:
 	for pytest in $(PYTESTS) ; do \
 	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 ; \
 	done

+ 1 - 1
src/bin/bindctl/tests/Makefile.am

@@ -7,6 +7,6 @@ PYCOVERAGE = $(PYTHON)
 check-local:
 	for pytest in $(PYTESTS) ; do \
 	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 ; \
 	done

+ 1 - 1
src/bin/cmdctl/tests/Makefile.am

@@ -7,6 +7,6 @@ PYCOVERAGE = $(PYTHON)
 check-local:
 	for pytest in $(PYTESTS) ; do \
 	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 ; \
 	done

+ 0 - 2
src/bin/msgq/msgq.py.in

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

+ 1 - 1
src/bin/msgq/tests/Makefile.am

@@ -7,7 +7,7 @@ PYCOVERAGE = $(PYTHON)
 check-local:
 	for pytest in $(PYTESTS) ; do \
 	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 ; \
 	done
 

+ 1 - 1
src/bin/xfrin/tests/Makefile.am

@@ -9,7 +9,7 @@ PYCOVERAGE = $(PYTHON)
 check-local:
 	for pytest in $(PYTESTS) ; do \
 	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 ; \
 	done
 

+ 1 - 1
src/bin/xfrout/tests/Makefile.am

@@ -9,7 +9,7 @@ PYCOVERAGE = $(PYTHON)
 check-local:
 	for pytest in $(PYTESTS) ; do \
 	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 ; \
 	done
 

+ 2 - 6
src/lib/python/isc/cc/session.py.in

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

+ 1 - 1
src/lib/python/isc/cc/tests/Makefile.am

@@ -10,6 +10,6 @@ PYCOVERAGE = $(PYTHON)
 check-local:
 	for pytest in $(PYTESTS) ; do \
 	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 ; \
 	done

+ 1 - 1
src/lib/python/isc/config/tests/Makefile.am

@@ -9,7 +9,7 @@ PYCOVERAGE = $(PYTHON)
 check-local:
 	for pytest in $(PYTESTS) ; do \
 	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 \
 	$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
 	done