mirror of
https://github.com/ceph/ceph
synced 2025-02-24 11:37:37 +00:00
cephadm: validate fsid during ceph-volume command
Signed-off-by: Michael Fritch <mfritch@suse.com>
This commit is contained in:
parent
25febfd9e0
commit
f0609429c0
@ -4634,6 +4634,7 @@ def command_enter(ctx):
|
||||
|
||||
@infer_fsid
|
||||
@infer_image
|
||||
@validate_fsid
|
||||
def command_ceph_volume(ctx):
|
||||
# type: (CephadmContext) -> None
|
||||
cp = read_config(ctx.config)
|
||||
|
@ -1545,6 +1545,14 @@ class TestCephVolume(object):
|
||||
cd.command_ceph_volume(ctx)
|
||||
assert ctx.fsid == fsid
|
||||
|
||||
cmd = self._get_cmd('--fsid', '00000000-0000-0000-0000-0000deadbeez')
|
||||
with with_cephadm_ctx(cmd) as ctx:
|
||||
err = 'not an fsid'
|
||||
with pytest.raises(cd.Error, match=err):
|
||||
retval = cd.command_shell(ctx)
|
||||
assert retval == 1
|
||||
assert ctx.fsid == None
|
||||
|
||||
s = get_ceph_conf(fsid=fsid)
|
||||
f = cephadm_fs.create_file('ceph.conf', contents=s)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user