[IMP] xmlrpc: version() moved to common, still available on /openerp/xmlrpc.
bzr revid: vmt@openerp.com-20110930135942-ytlxz7vlwl84myg0
This commit is contained in:
@@ -49,6 +49,8 @@ import openerp.exceptions
|
||||
procedures to be called. Each method has its own arguments footprint.
|
||||
"""
|
||||
|
||||
RPC_VERSION_1 = {'server_version': '6.1', 'protocol_version': 1}
|
||||
|
||||
# This should be moved to openerp.modules.db, along side initialize().
|
||||
def _initialize_db(serv, id, db_name, demo, lang, user_password):
|
||||
cr = None
|
||||
@@ -377,7 +379,7 @@ class common(netsvc.ExportService):
|
||||
return res or False
|
||||
elif method in ['about', 'timezone_get', 'get_server_environment',
|
||||
'login_message','get_stats', 'check_connectivity',
|
||||
'list_http_services']:
|
||||
'list_http_services', 'version']:
|
||||
pass
|
||||
elif method in ['get_available_updates', 'get_migration_scripts', 'set_loglevel', 'get_os_time', 'get_sqlcount']:
|
||||
passwd = params[0]
|
||||
@@ -389,6 +391,9 @@ class common(netsvc.ExportService):
|
||||
fn = getattr(self, 'exp_'+method)
|
||||
return fn(*params)
|
||||
|
||||
def exp_version(self):
|
||||
return RPC_VERSION_1
|
||||
|
||||
def exp_about(self, extended=False):
|
||||
"""Return information about the OpenERP Server.
|
||||
|
||||
|
||||
+1
-5
@@ -63,8 +63,6 @@ XML_RPC_PATH_1 = '/openerp/xmlrpc/1'
|
||||
JSON_RPC_PATH = '/openerp/jsonrpc'
|
||||
JSON_RPC_PATH_1 = '/openerp/jsonrpc/1'
|
||||
|
||||
XML_RPC_VERSION_1 = {'server_version': '6.1', 'protocol_version': 1}
|
||||
|
||||
def xmlrpc_return(start_response, service, method, params, legacy_exceptions=False):
|
||||
"""
|
||||
Helper to call a service's method with some params, using a wsgi-supplied
|
||||
@@ -208,9 +206,7 @@ def wsgi_xmlrpc(environ, start_response):
|
||||
# All routes are hard-coded.
|
||||
|
||||
if len(path) == 1 and path[0] == '' and method in ('version',):
|
||||
response = xmlrpclib.dumps((XML_RPC_VERSION_1,), methodresponse=1, allow_none=False, encoding=None)
|
||||
start_response("200 OK", [('Content-Type','text/xml'), ('Content-Length', str(len(response)))])
|
||||
return [response]
|
||||
return xmlrpc_return(start_response, 'common', method, ())
|
||||
|
||||
# The body has been read, need to raise an exception (not return None).
|
||||
fault = xmlrpclib.Fault(XML_RPC_FAULT_CODE_CLIENT_ERROR, '')
|
||||
|
||||
Reference in New Issue
Block a user