]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
cephadm: check if file exists when passing `--apply_spec` 57185/head
authorGuillaume Abrioux <gabrioux@ibm.com>
Wed, 10 Apr 2024 13:00:21 +0000 (15:00 +0200)
committerAdam King <adking@redhat.com>
Tue, 30 Apr 2024 19:31:31 +0000 (15:31 -0400)
commitb0a3ca9e84e6bb2d18a8f9a0699bda254e535129
treea32c20800731d2fc79f0b63cae7d52f3ae7e368f
parent4aca8752dee59d58a351d0630c31faa913c1d88b
cephadm: check if file exists when passing `--apply_spec`

cephadm deploys the cluster, fails and does a rollback.
If the passed file doesn't exist we can make the CLI fail early instead.

```

... omitted output ...

Applying ../host-spec.yaml to cluster
FileNotFoundError: [Errno 2] No such file or directory: '../host-spec.yaml'

        ***************
        Cephadm hit an issue during cluster installation. Current cluster files will be deleted automatically.
        To disable this behaviour you can pass the --no-cleanup-on-failure flag. In case of any previous
        broken installation, users must use the following command to completely delete the broken cluster:

        > cephadm rm-cluster --force --zap-osds --fsid <fsid>

        for more information please refer to https://docs.ceph.com/en/latest/cephadm/operations/#purging-a-cluster
        ***************

Deleting cluster with fsid: 6e6a2dbe-f73a-11ee-8262-98be948800fd
Traceback (most recent call last):
  File "/usr/lib64/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/tmpive4g9gs.cephadm.build/app/__main__.py", line 5615, in <module>
  File "/tmp/tmpive4g9gs.cephadm.build/app/__main__.py", line 5603, in main
  File "/tmp/tmpive4g9gs.cephadm.build/app/__main__.py", line 2693, in _rollback
  File "/tmp/tmpive4g9gs.cephadm.build/app/__main__.py", line 445, in _default_image
  File "/tmp/tmpive4g9gs.cephadm.build/app/__main__.py", line 2958, in command_bootstrap
FileNotFoundError: [Errno 2] No such file or directory: '../host-spec.yaml'
```

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit 2ede1484925452c1ba717de0b9e8f9310c128bfb)
src/cephadm/cephadm.py