diff --git a/bin/migrate.py b/bin/migrate.py index c3512734..363aa736 100755 --- a/bin/migrate.py +++ b/bin/migrate.py @@ -668,13 +668,13 @@ def write_env_secret(build_dir, version): if "PGPASSWORD" in os.environ: overwrite_values["PGPASSWORD"] = os.environ["PGPASSWORD"] if params["enterprise-enabled"]: - overwrite_values[ - "DEFAULT_REPO_PATTERN_ODOO" - ] = "https://github.com/odoo/odoo.git" + overwrite_values["DEFAULT_REPO_PATTERN_ODOO"] = ( + "https://github.com/odoo/odoo.git" + ) elif float(version) < 14.0 and version != params["start-version"]: - overwrite_values[ - "DEFAULT_REPO_PATTERN_ODOO" - ] = "https://github.com/OCA/OpenUpgrade.git" + overwrite_values["DEFAULT_REPO_PATTERN_ODOO"] = ( + "https://github.com/OCA/OpenUpgrade.git" + ) rewritten_lines = [] lines = [] @@ -1041,10 +1041,21 @@ def check_process_status(proc): proc.kill() mark_enterprise_done(version) - if not params["no-backups"]: - copy_database(enterprise_database, os.environ["PGDATABASE"], True) - else: - rename_database(enterprise_database, os.environ["PGDATABASE"]) + try: + if not params["no-backups"]: + copy_database(enterprise_database, os.environ["PGDATABASE"], True) + else: + rename_database(enterprise_database, os.environ["PGDATABASE"]) + except CommandFailedException as e: + logging.error( + "Failed because we weren't able to get the enterprise database in " + "place of the original one. No worries, the migrated database " + "still exists, but someone needs to resolve the error, execute " + "the following command, and restart the migration script:\n" + f"createdb \"{os.environ['PGDATABASE']}\" -T " + f'"{enterprise_database}"' + ) + raise e def run_migration(start_version, target_version): diff --git a/templates/16.0/requirements-default.txt b/templates/16.0/requirements-default.txt index 5acb85e6..d76fa0c0 100644 --- a/templates/16.0/requirements-default.txt +++ b/templates/16.0/requirements-default.txt @@ -61,21 +61,20 @@ ptvsd==5.0.0a4 pudb==2019.1 pydot==1.4.1 Pygments==2.10.0 -pyldap==2.4.28 pyopenssl==22.0.0 pyparsing==2.2.0 PyPDF2==1.26.0 pyserial==3.4 python-dateutil==2.8.2 python-dotenv==0.17.1 -python-ldap==3.4.0 +python-ldap==3.4.4 python-magic==0.4.24 python-stdnum==1.13 pytz==2021.1 pyusb==1.0.2 qrcode==6.1 raven==6.10.0 -reportlab==3.5.59 +reportlab==3.6.13 requests==2.26.0 requests-toolbelt==0.9.1 Shapely==2.0.0