Author: aconway
Date: Tue Jun 3 15:52:22 2014
New Revision: 1599631
URL: http://svn.apache.org/r1599631
Log:
DISPATCH-56: Remove module-level SCHEMA in qdrouter.py
This was a bad idea, if the schema file changes the python compiler will
not know that it needs to recompile the .pyc and mayhem ensues.
Always create the qdrouter.Schema() object at runtime.
Modified:
qpid/dispatch/trunk/doc/man/qdrouterd_man.py
qpid/dispatch/trunk/python/qpid_dispatch_internal/management/qdrouter.py
Modified: qpid/dispatch/trunk/doc/man/qdrouterd_man.py
URL:
http://svn.apache.org/viewvc/qpid/dispatch/trunk/doc/man/qdrouterd_man.py?rev=1599631&r1=1599630&r2=1599631&view=diff
==============================================================================
--- qpid/dispatch/trunk/doc/man/qdrouterd_man.py (original)
+++ qpid/dispatch/trunk/doc/man/qdrouterd_man.py Tue Jun 3 15:52:22 2014
@@ -21,10 +21,10 @@
Generate the qdrouterd.conf man page from the qdrouterd management schema."""
import sys
-from qpid_dispatch_internal.management.qdrouter import SCHEMA
+from qpid_dispatch_internal.management.qdrouter import Schema
def make_man_page(filename):
- """Generate a man page for the configuration file from L{SCHEMA}
descriptions"""
+ """Generate a man page for the configuration file from L{Schema}
descriptions"""
with open(filename, 'w') as f:
f.write(
@@ -99,11 +99,12 @@ the attributes associated with each type
for attr in attrs.attributes.itervalues():
write_attribute(attr, attrs)
- for include in SCHEMA.includes.itervalues():
+ schema = Schema()
+ for include in schema.includes.itervalues():
f.write('.SS "\'%s\' include group"\n'% include.name)
write_attributes(include)
- for name, entity_type in SCHEMA.entity_types.iteritems():
+ for name, entity_type in schema.entity_types.iteritems():
f.write('.SS "\'%s\' entity"\n'% name)
f.write('Includes: %s\n\n'%(', '.join(entity_type.include)))
write_attributes(entity_type)
Modified:
qpid/dispatch/trunk/python/qpid_dispatch_internal/management/qdrouter.py
URL:
http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch_internal/management/qdrouter.py?rev=1599631&r1=1599630&r2=1599631&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch_internal/management/qdrouter.py
(original)
+++ qpid/dispatch/trunk/python/qpid_dispatch_internal/management/qdrouter.py
Tue Jun 3 15:52:22 2014
@@ -53,14 +53,11 @@ class Schema(schema.Schema):
if connect['role'] != 'normal':
raise schema.SchemaError("Role '%s' for entity '%s' only
permitted with 'interior' mode % (entity['role'], connect.name)")
-SCHEMA = Schema()
-"""Instance of the Qpid Dispatch Router management schema""" # pylint:
disable=pointless-string-statement
-
class Configuration(EntityList):
- """An L{EntityList} loaded from a qdrouterd.conf and validated against
L{SCHEMA}."""
+ """An L{EntityList} loaded from a qdrouterd.conf and validated against
L{Schema}."""
- def __init__(self):
- super(Configuration, self).__init__(SCHEMA)
+ def __init__(self, schema=Schema()):
+ super(Configuration, self).__init__(schema)
@staticmethod
def _parse(lines):
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]