Thanks for addressing Dumitru's concerns.

Acked-by: Mark Michelson <[email protected]>

On Mon, Aug 10, 2026 at 12:47 PM Ales Musil via dev
<[email protected]> wrote:
>
> The local OVN repository might be shallow copy which doesn't work
> well with the --local. Also the local repository might already
> have up to date submodule which makes any subsequent submodule init
> calls a noop. This is especially useful in offline environments
> where would the submodule update fail otherwise. The copy is done
> in two steps otherwise it would end up in endless recursion as the
> base dir is inside the ovn_root_dir.
>
> Fixes: 9b2645580c78 ("ci: Run system tests in upgrade scenario.")
> Signed-off-by: Ales Musil <[email protected]>
> ---
> v2: Rebase on top of current main.
>     Add try around shutil.
> ---
>  .ci/ovn_upgrade_utils.py | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/.ci/ovn_upgrade_utils.py b/.ci/ovn_upgrade_utils.py
> index c0db4977f..cf39aedf9 100755
> --- a/.ci/ovn_upgrade_utils.py
> +++ b/.ci/ovn_upgrade_utils.py
> @@ -4,6 +4,7 @@ import os
>  import re
>  import shutil
>  import subprocess
> +import tempfile
>  from datetime import datetime
>  from pathlib import Path
>  from dataclasses import dataclass
> @@ -294,13 +295,16 @@ def ovn_upgrade_extract_info(config):
>  def ovn_upgrade_checkout_local(config, base_version):
>      base_dir = config.path.base_dir
>      git_log = config.file.git_log
> -    log(f"Running locally. Cloning to {base_dir}")
> +    log(f"Running locally. Copying to {base_dir}")
>
> -    result = run_command(f"git clone --local --shared . {str(base_dir)} "
> -                         f" --branch {base_version}", git_log)
> -    if result.returncode:
> -        log(f"Failed to clone to {base_dir}")
> -        return False
> +    with tempfile.TemporaryDirectory() as tmpdir:
> +        tmp_path = Path(tmpdir) / "ovn"
> +        try:
> +            shutil.copytree(config.path.ovn_root_dir, tmp_path)
> +            shutil.copytree(tmp_path, base_dir, dirs_exist_ok=True)
> +        except Exception as e:
> +            log(f"Failed to copy the OVN repository locally: {e}")
> +            return False
>
>      with chdir(base_dir):
>          log(f"Checking out base version: {base_version} from {base_dir}")
> --
> 2.55.0
>
> _______________________________________________
> dev mailing list
> [email protected]
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to