[pyro] merge pyro-id / pyro-instance-id options, put all pyro options in the same section of the configuration file
--- a/cwconfig.py Wed Sep 30 21:06:09 2009 +0200
+++ b/cwconfig.py Thu Oct 01 08:49:29 2009 +0200
@@ -168,20 +168,26 @@
'help': 'server\'s log level',
'group': 'main', 'inputlevel': 1,
}),
- # pyro name server
+ # pyro options
+ ('pyro-instance-id',
+ {'type' : 'string',
+ 'default': Method('default_instance_id'),
+ 'help': 'identifier of the CubicWeb instance in the Pyro name server',
+ 'group': 'pyro', 'inputlevel': 1,
+ }),
('pyro-ns-host',
{'type' : 'string',
'default': '',
'help': 'Pyro name server\'s host. If not set, will be detected by a \
broadcast query. It may contains port information using <host>:<port> notation.',
- 'group': 'pyro-name-server', 'inputlevel': 1,
+ 'group': 'pyro', 'inputlevel': 1,
}),
('pyro-ns-group',
{'type' : 'string',
'default': 'cubicweb',
'help': 'Pyro name server\'s group where the repository will be \
registered.',
- 'group': 'pyro-name-server', 'inputlevel': 1,
+ 'group': 'pyro', 'inputlevel': 1,
}),
# common configuration options which are potentially required as soon as
# you're using "base" application objects (ie to really server/web
--- a/goa/goaconfig.py Wed Sep 30 21:06:09 2009 +0200
+++ b/goa/goaconfig.py Thu Oct 01 08:49:29 2009 +0200
@@ -17,7 +17,7 @@
from cubicweb.goa.dbmyams import load_schema
UNSUPPORTED_OPTIONS = set(('connections-pool-size',
- 'pyro-host', 'pyro-id', 'pyro-instance-id',
+ 'pyro-host', 'pyro-instance-id',
'pyro-ns-host', 'pyro-ns-group',
'https-url', 'host', 'pid-file', 'uid', 'base-url', 'log-file',
'smtp-host', 'smtp-port',
--- a/server/repository.py Wed Sep 30 21:06:09 2009 +0200
+++ b/server/repository.py Thu Oct 01 08:49:29 2009 +0200
@@ -1191,7 +1191,7 @@
def pyro_register(self, host=''):
"""register the repository as a pyro object"""
from logilab.common.pyro_ext import register_object
- appid = self.config['pyro-id'] or self.config.appid
+ appid = self.config['pyro-instance-id'] or self.config.appid
daemon = register_object(self, appid, self.config['pyro-ns-group'],
self.config['pyro-host'],
self.config['pyro-ns-host'])
@@ -1224,7 +1224,7 @@
def pyro_unregister(config):
"""unregister the repository from the pyro name server"""
from logilab.common.pyro_ext import ns_unregister
- appid = config['pyro-id'] or config.appid
+ appid = config['pyro-instance-id'] or config.appid
ns_unregister(appid, config['pyro-ns-group'], config['pyro-ns-host'])
--- a/server/serverconfig.py Wed Sep 30 21:06:09 2009 +0200
+++ b/server/serverconfig.py Thu Oct 01 08:49:29 2009 +0200
@@ -168,13 +168,7 @@
'help': 'Pyro server host, if not detectable correctly through \
gethostname(). It may contains port information using <host>:<port> notation, \
and if not set, it will be choosen randomly',
- 'group': 'pyro-server', 'inputlevel': 2,
- }),
- ('pyro-id', # XXX reuse pyro-instance-id
- {'type' : 'string',
- 'default': None,
- 'help': 'identifier of the repository in the pyro name server',
- 'group': 'pyro-server', 'inputlevel': 2,
+ 'group': 'pyro', 'inputlevel': 2,
}),
) + CubicWebConfiguration.options)
--- a/server/serverctl.py Wed Sep 30 21:06:09 2009 +0200
+++ b/server/serverctl.py Thu Oct 01 08:49:29 2009 +0200
@@ -126,8 +126,11 @@
config = self.config
print underline_title('Configuring the repository')
config.input_config('email', inputlevel)
- if config.pyro_enabled():
- config.input_config('pyro-server', inputlevel)
+ # ask for pyro configuration if pyro is activated and we're not using a
+ # all-in-one config, in which case this is done by the web side command
+ # handler
+ if config.pyro_enabled() and config.name != 'all-in-one':
+ config.input_config('pyro', inputlevel)
print '\n'+underline_title('Configuring the sources')
sourcesfile = config.sources_file()
sconfig = Configuration(options=SOURCE_TYPES['native'].options)
--- a/web/webconfig.py Wed Sep 30 21:06:09 2009 +0200
+++ b/web/webconfig.py Thu Oct 01 08:49:29 2009 +0200
@@ -86,12 +86,6 @@
'help': 'web instance query log file',
'group': 'main', 'inputlevel': 2,
}),
- ('pyro-instance-id',
- {'type' : 'string',
- 'default': Method('default_instance_id'),
- 'help': 'CubicWeb instance identifier in the Pyro name server',
- 'group': 'pyro-client', 'inputlevel': 1,
- }),
# web configuration
('https-url',
{'type' : 'string',
--- a/web/webctl.py Wed Sep 30 21:06:09 2009 +0200
+++ b/web/webctl.py Thu Oct 01 08:49:29 2009 +0200
@@ -17,11 +17,11 @@
def bootstrap(self, cubes, inputlevel=0):
"""bootstrap this configuration"""
- print '\n'+underline_title('Generic web configuration')
+ print '\n' + underline_title('Generic web configuration')
config = self.config
if config.repo_method == 'pyro':
- print '\n'+underline_title('Repository server configuration')
- config.input_config('pyro-client', inputlevel)
+ print '\n' + underline_title('Pyro configuration')
+ config.input_config('pyro', inputlevel)
if ASK.confirm('Allow anonymous access ?', False):
config.global_set_option('anonymous-user', 'anon')
config.global_set_option('anonymous-password', 'anon')