Parcourir la source

[2856] Rename memmgr module mes file to libmemmgr to avoid conflict

Mukund Sivaraman il y a 12 ans
Parent
commit
40471d97b2

+ 2 - 0
src/lib/python/isc/log_messages/Makefile.am

@@ -4,6 +4,7 @@ EXTRA_DIST = __init__.py
 EXTRA_DIST += init_messages.py
 EXTRA_DIST += cmdctl_messages.py
 EXTRA_DIST += ddns_messages.py
+EXTRA_DIST += libmemmgr_messages.py
 EXTRA_DIST += memmgr_messages.py
 EXTRA_DIST += stats_messages.py
 EXTRA_DIST += stats_httpd_messages.py
@@ -25,6 +26,7 @@ CLEANFILES = __init__.pyc
 CLEANFILES += init_messages.pyc
 CLEANFILES += cmdctl_messages.pyc
 CLEANFILES += ddns_messages.pyc
+CLEANFILES += libmemmgr_messages.pyc
 CLEANFILES += memmgr_messages.pyc
 CLEANFILES += stats_messages.pyc
 CLEANFILES += stats_httpd_messages.pyc

+ 1 - 0
src/lib/python/isc/log_messages/libmemmgr_messages.py

@@ -0,0 +1 @@
+from work.libmemmgr_messages import *

+ 7 - 7
src/lib/python/isc/memmgr/Makefile.am

@@ -4,20 +4,20 @@ python_PYTHON = __init__.py builder.py datasrc_info.py logger.py
 
 pythondir = $(pyexecdir)/isc/memmgr
 
-BUILT_SOURCES = $(PYTHON_LOGMSGPKG_DIR)/work/memmgr_messages.py
+BUILT_SOURCES = $(PYTHON_LOGMSGPKG_DIR)/work/libmemmgr_messages.py
 
-nodist_pylogmessage_PYTHON = $(PYTHON_LOGMSGPKG_DIR)/work/memmgr_messages.py
+nodist_pylogmessage_PYTHON = $(PYTHON_LOGMSGPKG_DIR)/work/libmemmgr_messages.py
 
 pylogmessagedir = $(pyexecdir)/isc/log_messages/
 
-CLEANFILES = $(PYTHON_LOGMSGPKG_DIR)/work/memmgr_messages.py
-CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/memmgr_messages.pyc
+CLEANFILES = $(PYTHON_LOGMSGPKG_DIR)/work/libmemmgr_messages.py
+CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/libmemmgr_messages.pyc
 
-EXTRA_DIST = memmgr_messages.mes
+EXTRA_DIST = libmemmgr_messages.mes
 
-$(PYTHON_LOGMSGPKG_DIR)/work/memmgr_messages.py : memmgr_messages.mes
+$(PYTHON_LOGMSGPKG_DIR)/work/libmemmgr_messages.py : libmemmgr_messages.mes
 	$(top_builddir)/src/lib/log/compiler/message \
-	-d $(PYTHON_LOGMSGPKG_DIR)/work -p $(srcdir)/memmgr_messages.mes
+	-d $(PYTHON_LOGMSGPKG_DIR)/work -p $(srcdir)/libmemmgr_messages.mes
 
 CLEANDIRS = __pycache__
 

+ 5 - 5
src/lib/python/isc/memmgr/builder.py

@@ -17,7 +17,7 @@ import json
 from isc.datasrc import ConfigurableClientList
 from isc.memmgr.datasrc_info import SegmentInfo
 
-from isc.log_messages.memmgr_messages import *
+from isc.log_messages.libmemmgr_messages import *
 from isc.memmgr.logger import logger
 
 class MemorySegmentBuilder:
@@ -69,7 +69,7 @@ class MemorySegmentBuilder:
         # in this case as we are likely running in a different thread
         # from the main thread which would need to be notified. Instead
         # return this in the response queue.
-        logger.error(MEMMGR_BUILDER_BAD_COMMAND_ERROR, bad_command)
+        logger.error(LIBMEMMGR_BUILDER_BAD_COMMAND_ERROR, bad_command)
         self._response_queue.append(('bad_command',))
         self._shutdown = True
 
@@ -110,16 +110,16 @@ class MemorySegmentBuilder:
             result, writer = clist.get_cached_zone_writer(zone_name, catch_load_error,
                                                           dsrc_name)
             if result != ConfigurableClientList.CACHE_STATUS_ZONE_SUCCESS:
-                logger.error(MEMMGR_BUILDER_GET_ZONE_WRITER_ERROR, zone_name, dsrc_name)
+                logger.error(LIBMEMMGR_BUILDER_GET_ZONE_WRITER_ERROR, zone_name, dsrc_name)
                 continue
 
             try:
                 error = writer.load()
                 if error is not None:
-                    logger.error(MEMMGR_BUILDER_ZONE_WRITER_LOAD_1_ERROR, zone_name, dsrc_name, error)
+                    logger.error(LIBMEMMGR_BUILDER_ZONE_WRITER_LOAD_1_ERROR, zone_name, dsrc_name, error)
                     continue
             except Exception as e:
-                logger.error(MEMMGR_BUILDER_ZONE_WRITER_LOAD_2_ERROR, zone_name, dsrc_name, str(e))
+                logger.error(LIBMEMMGR_BUILDER_ZONE_WRITER_LOAD_2_ERROR, zone_name, dsrc_name, str(e))
                 continue
             writer.install()
             writer.cleanup()

+ 4 - 4
src/lib/python/isc/memmgr/memmgr_messages.mes

@@ -15,21 +15,21 @@
 # No namespace declaration - these constants go in the global namespace
 # of the config_messages python module.
 
-% MEMMGR_BUILDER_BAD_COMMAND_ERROR MemorySegmentBuilder received bad command '%1'
+% LIBMEMMGR_BUILDER_BAD_COMMAND_ERROR MemorySegmentBuilder received bad command '%1'
 The MemorySegmentBuilder has received a bad command in its input command
 queue. This is likely a programming error. If the builder runs in a
 separate thread, this would cause it to exit the thread.
 
-% MEMMGR_BUILDER_GET_ZONE_WRITER_ERROR Unable to get zone writer for zone '%1', data source '%2'. Skipping.
+% LIBMEMMGR_BUILDER_GET_ZONE_WRITER_ERROR Unable to get zone writer for zone '%1', data source '%2'. Skipping.
 The MemorySegmentBuilder was unable to get a ZoneWriter for the
 specified zone when handling the load command. This zone will be
 skipped.
 
-% MEMMGR_BUILDER_ZONE_WRITER_LOAD_1_ERROR Error loading zone '%1', data source '%2': '%3'
+% LIBMEMMGR_BUILDER_ZONE_WRITER_LOAD_1_ERROR Error loading zone '%1', data source '%2': '%3'
 The MemorySegmentBuilder failed to load the specified zone when handling
 the load command. This zone will be skipped.
 
-% MEMMGR_BUILDER_ZONE_WRITER_LOAD_2_ERROR Error loading zone '%1', data source '%2': '%3'
+% LIBMEMMGR_BUILDER_ZONE_WRITER_LOAD_2_ERROR Error loading zone '%1', data source '%2': '%3'
 An exception occured when the MemorySegmentBuilder tried to load the
 specified zone when handling the load command. This zone will be
 skipped.

+ 1 - 1
src/lib/python/isc/memmgr/logger.py

@@ -17,4 +17,4 @@
 
 import isc.log
 
-logger = isc.log.Logger("memmgr")
+logger = isc.log.Logger("libmemmgr")