From 6dc790d2da3cacf18ca97f89f7b0bfab946fcab6 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Mon, 27 Aug 2018 13:25:43 +0200 Subject: [PATCH] [FIX] packaging: find admin uid when testing packages Since 2f7c03d the admin user could have any uid and the uid 1 is reserved for the system user. As the uid was hardcoded as 1 when testing packages, the tests were failing. With this commit, the uid of the admin user is searched before testing the packages. Closes #26603 --- setup/package.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup/package.py b/setup/package.py index dd15b84e224..1954a20b33e 100755 --- a/setup/package.py +++ b/setup/package.py @@ -75,13 +75,16 @@ def system(l, chdir=None): def _rpc_count_modules(addr='http://127.0.0.1', port=8069, dbname='mycompany'): time.sleep(5) + uid = xmlrpclib.ServerProxy('%s:%s/xmlrpc/common' % (addr, port)).authenticate( + dbname, 'admin', 'admin', {} + ) modules = xmlrpclib.ServerProxy('%s:%s/xmlrpc/object' % (addr, port)).execute( - dbname, 1, 'admin', 'ir.module.module', 'search', [('state', '=', 'installed')] + dbname, uid, 'admin', 'ir.module.module', 'search', [('state', '=', 'installed')] ) if modules and len(modules) > 1: time.sleep(1) toinstallmodules = xmlrpclib.ServerProxy('%s:%s/xmlrpc/object' % (addr, port)).execute( - dbname, 1, 'admin', 'ir.module.module', 'search', [('state', '=', 'to install')] + dbname, uid, 'admin', 'ir.module.module', 'search', [('state', '=', 'to install')] ) if toinstallmodules: logging.error("Package test: FAILED. Not able to install dependencies of base.")