api: cephfs: check if SID is free when add_storage is set

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2018-11-23 18:35:16 +01:00
parent 6ad96d041e
commit 34c1236c35

View File

@ -8,6 +8,7 @@ use PVE::JSONSchema qw(get_standard_option);
use PVE::RADOS;
use PVE::RESTHandler;
use PVE::RPCEnvironment;
use PVE::Storage;
use PVE::API2::Storage::Config;
@ -138,6 +139,8 @@ __PACKAGE__->register_method ({
my $running_mds = PVE::CephTools::get_cluster_mds_state($rados);
die "no running Metadata Server (MDS) found!\n" if !scalar(keys %$running_mds);
PVE::Storage::assert_sid_unused($fs_name) if $param->{add_storage};
my $worker = sub {
$rados = PVE::RADOS->new();