summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Monniez <moc@odoo.com>2018-08-27 13:25:43 +0200
committerGitHub <noreply@github.com>2018-08-27 13:25:43 +0200
commit6dc790d2da3cacf18ca97f89f7b0bfab946fcab6 (patch)
treec77084359ffb5cbf23a680d3b2c52c36817f9dd1
parent0e307f8280eda4343a63c7faa2d52e33d46c9c0c (diff)
[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
-rwxr-xr-xsetup/package.py7
1 files 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.")