[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
import yaml
from odoo_openupgrade_wizard.tools_docker import kill_container, run_container
# WIP
def get_odoo_addons_path(ctx, odoo_version: dict, migration_step: dict) -> str:
pass
# repo_file = Path(
# self._current_directory,
# CUSTOMER_CONFIG_FOLDER,
# "repo_files",
# "%s.yml" % step["version"],
# )
def get_odoo_addons_path(ctx, migration_step: dict) -> str:
odoo_version = get_odoo_version_from_migration_step(ctx, migration_step)
repo_file = get_odoo_env_path(ctx, odoo_version) / Path("repos.yml")
# folder = Path(self._current_directory, step["local_path"])
# base_module_folder = get_base_module_folder(step)
# stream = open(repo_file, "r")
# data = yaml.safe_load(stream)
stream = open(repo_file, "r")
data = yaml.safe_load(stream)
data = data
# addons_path = []
# for key in data.keys():
@ -76,6 +74,7 @@ def generate_odoo_command(
demo: bool,
) -> str:
# 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"
database_cmd = database and "--database %s" % database 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(
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.
- directory is created if it doesn't exist.
@ -21,8 +21,7 @@ def ensure_folder_exists(
"""
if not folder_path.exists():
cmd = ["--parents", folder_path]
if mode:
cmd = ["--mode", "755"] + cmd
cmd = ["--mode", mode] + cmd
logger.info("Creating folder '%s' ..." % (folder_path))
mkdir(cmd)