Skip to content

Allow overwriting the user when running `wl user import`

Why do we assume that wl user import <user_manifest_path> should fail if the given manifest refers to an already imported user? What if I want to override the user? I would expect to be able to run wl user import --force-reimport <user_manifest_path> to force reimporting the user.

Currently there is no such an option:

user@dae0ccc8a0b7:~/wildland-client$ wl u import --help
Usage: wl u import [OPTIONS] PATH_OR_URL

  Import a provided user or bridge manifest. Accepts a local path, an url or a
  Wildland path to manifest or to bridge. Optionally override bridge paths
  with paths provided via --path. Created bridge manifests will use system
  @default-owner, or --bridge-owner is specified.

Options:
  --path TEXT          path for resulting bridge manifest (can be repeated);
                       if omitted, will use user's paths
  --bridge-owner TEXT  specify a different (then default) user to be used as
                       the owner of created bridge manifests
  --only-first         import only first encountered bridge (ignored in all
                       cases except WL container paths)  [default: False]
  --help               Show this message and exit.  [default: False]

user@dae0ccc8a0b7:~/wildland-client$ wl b import --help
Usage: wl b import [OPTIONS] PATH_OR_URL

  Import a provided user or bridge manifest. Accepts a local path, an url or a
  Wildland path to manifest or to bridge. Optionally override bridge paths
  with paths provided via --path. Created bridge manifests will use system
  @default-owner, or --bridge-owner is specified.

Options:
  --path TEXT          path for resulting bridge manifest (can be repeated);
                       if omitted, will use user's paths
  --bridge-owner TEXT  specify a different (then default) user to be used as
                       the owner of created bridge manifests
  --only-first         import only first encountered bridge (ignored in all
                       cases except WL container paths)  [default: False]
  --help               Show this message and exit.  [default: False]

I came across this problem while playing around with forests with @mhaponiuk.

Edited by Patryk Bęza