diff --git a/odoo_openupgrade_wizard/tools/tools_postgres.py b/odoo_openupgrade_wizard/tools/tools_postgres.py index de87fb5..d719944 100644 --- a/odoo_openupgrade_wizard/tools/tools_postgres.py +++ b/odoo_openupgrade_wizard/tools/tools_postgres.py @@ -83,7 +83,7 @@ def execute_sql_file(ctx, database, sql_file): container_path = Path("/env/") / relative_path docker_command = ( - "psql" " --username=odoo" " --dbname={database}" " --file {file_path}" + "psql --username=odoo --dbname={database} --file {file_path}" ).format(database=database, file_path=container_path) logger.info( "Executing the script '%s' in postgres container" @@ -91,6 +91,7 @@ def execute_sql_file(ctx, database, sql_file): ) docker_result = container.exec_run(docker_command) if docker_result.exit_code != 0: + logger.error(docker_result.output) raise Exception( "The script '%s' failed on database %s. Exit Code : %d" % (relative_path, database, docker_result.exit_code) diff --git a/tests/data/extra_script/post-migration-custom_test.py b/tests/data/extra_script/post-migration-custom_test.py index 319cf96..ba18852 100644 --- a/tests/data/extra_script/post-migration-custom_test.py +++ b/tests/data/extra_script/post-migration-custom_test.py @@ -7,7 +7,7 @@ env = env # noqa: F821 for i in range(0, 10): partner_name = "Partner #%d" % (i) - _logger.info("Create Partner %s") + _logger.info("Create Partner %s" % partner_name) env["res.partner"].create({"name": partner_name}) _logger.info("post-migration-custom_test.py : End of script.")