On 8/10/26 10:28 AM, Ales Musil via dev 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]>
> ---

Hi Ales,

>  .ci/ovn_upgrade_utils.py | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/.ci/ovn_upgrade_utils.py b/.ci/ovn_upgrade_utils.py
> index c0db4977f..c5018a4b6 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,12 @@ 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"
> +        shutil.copytree(config.path.ovn_root_dir, tmp_path)
> +        shutil.copytree(tmp_path, base_dir, dirs_exist_ok=True)

We wrap all other shutil function calls into try/except, should we do
that here too?

>  
>      with chdir(base_dir):
>          log(f"Checking out base version: {base_version} from {base_dir}")

Regards,
Dumitru

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

Reply via email to