[FIX] CI broken, 755 is always set even if 777 is set

This commit is contained in:
Sylvain LE GAL 2022-04-27 18:31:59 +02:00
parent b251a80228
commit 31651fcbee
2 changed files with 11 additions and 13 deletions

View File

@ -1,21 +1,19 @@
from pathlib import Path from pathlib import Path
import yaml
from odoo_openupgrade_wizard.tools_docker import kill_container, run_container from odoo_openupgrade_wizard.tools_docker import kill_container, run_container
# WIP # WIP
def get_odoo_addons_path(ctx, odoo_version: dict, migration_step: dict) -> str: def get_odoo_addons_path(ctx, migration_step: dict) -> str:
pass odoo_version = get_odoo_version_from_migration_step(ctx, migration_step)
# repo_file = Path( repo_file = get_odoo_env_path(ctx, odoo_version) / Path("repos.yml")
# self._current_directory,
# CUSTOMER_CONFIG_FOLDER,
# "repo_files",
# "%s.yml" % step["version"],
# )
# folder = Path(self._current_directory, step["local_path"]) # folder = Path(self._current_directory, step["local_path"])
# base_module_folder = get_base_module_folder(step) # base_module_folder = get_base_module_folder(step)
# stream = open(repo_file, "r") stream = open(repo_file, "r")
# data = yaml.safe_load(stream) data = yaml.safe_load(stream)
data = data
# addons_path = [] # addons_path = []
# for key in data.keys(): # for key in data.keys():
@ -76,6 +74,7 @@ def generate_odoo_command(
demo: bool, demo: bool,
) -> str: ) -> str:
# TODO, make it dynamic # TODO, make it dynamic
# addons_path = get_odoo_addons_path(ctx, migration_step)
addons_path = "/odoo_env/src/odoo/addons," "/odoo_env/src/odoo/odoo/addons" addons_path = "/odoo_env/src/odoo/addons," "/odoo_env/src/odoo/odoo/addons"
database_cmd = database and "--database %s" % database or "" database_cmd = database and "--database %s" % database or ""
update_cmd = update and "--update_%s" % update or "" update_cmd = update and "--update_%s" % update or ""

View File

@ -12,7 +12,7 @@ from odoo_openupgrade_wizard import templates
def ensure_folder_exists( def ensure_folder_exists(
folder_path: Path, mode: str = False, git_ignore_content: bool = False folder_path: Path, mode: str = "755", git_ignore_content: bool = False
): ):
"""Create a local folder. """Create a local folder.
- directory is created if it doesn't exist. - directory is created if it doesn't exist.
@ -21,8 +21,7 @@ def ensure_folder_exists(
""" """
if not folder_path.exists(): if not folder_path.exists():
cmd = ["--parents", folder_path] cmd = ["--parents", folder_path]
if mode: cmd = ["--mode", mode] + cmd
cmd = ["--mode", "755"] + cmd
logger.info("Creating folder '%s' ..." % (folder_path)) logger.info("Creating folder '%s' ..." % (folder_path))
mkdir(cmd) mkdir(cmd)