[config] fix option group clash causing anonymous user configuration to end in the MAIN section instead of the WEB section if cubicweb-dev is installed stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 28 Feb 2011 14:14:19 +0100
branchstable
changeset 7032 b712477ae286
parent 7031 a04621040cad
child 7033 ddc1b4d80dbd
[config] fix option group clash causing anonymous user configuration to end in the MAIN section instead of the WEB section if cubicweb-dev is installed
__pkginfo__.py
devtools/__init__.py
misc/migration/3.10.9_Any.py
--- a/__pkginfo__.py	Mon Feb 28 14:12:42 2011 +0100
+++ b/__pkginfo__.py	Mon Feb 28 14:14:19 2011 +0100
@@ -1,5 +1,5 @@
 # pylint: disable=W0622,C0103
-# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -22,7 +22,7 @@
 
 modname = distname = "cubicweb"
 
-numversion = (3, 10, 8)
+numversion = (3, 10, 9)
 version = '.'.join(str(num) for num in numversion)
 
 description = "a repository of entities / relations for knowledge management"
--- a/devtools/__init__.py	Mon Feb 28 14:12:42 2011 +0100
+++ b/devtools/__init__.py	Mon Feb 28 14:14:19 2011 +0100
@@ -85,20 +85,10 @@
     read_instance_schema = False
     init_repository = True
     db_require_setup = True
-    options = cwconfig.merge_options(ServerConfiguration.options + (
-        ('anonymous-user',
-         {'type' : 'string',
-          'default': None,
-          'help': 'login of the CubicWeb user account to use for anonymous user (if you want to allow anonymous)',
-          'group': 'main', 'level': 1,
-          }),
-        ('anonymous-password',
-         {'type' : 'string',
-          'default': None,
-          'help': 'password of the CubicWeb user account matching login',
-          'group': 'main', 'level': 1,
-          }),
-        ))
+    options = cwconfig.merge_options(
+        ServerConfiguration.options +
+        tuple((opt, optdict) for opt, optdict in TwistedConfiguration.options
+              if opt in ('anonymous-user', 'anonymous-password')))
 
     def __init__(self, appid, apphome=None, log_threshold=logging.CRITICAL+10):
         # must be set before calling parent __init__
--- a/misc/migration/3.10.9_Any.py	Mon Feb 28 14:12:42 2011 +0100
+++ b/misc/migration/3.10.9_Any.py	Mon Feb 28 14:14:19 2011 +0100
@@ -1,4 +1,5 @@
 from __future__ import with_statement
+
 if confirm('fix existing cwuri?'):
     from logilab.common.shellutils import ProgressBar
     from cubicweb.server.session import hooks_control
@@ -11,3 +12,11 @@
                 commit(ask_confirm=False)
             pb.update()
     commit(ask_confirm=False)
+
+try:
+    from cubicweb import devtools
+    option_group_changed('anonymous-user', 'main', 'web')
+    option_group_changed('anonymous-password', 'main', 'web')
+except ImportError:
+    # cubicweb-dev unavailable, nothing needed
+    pass