From 9280153e10ba5d4e1da25d5f09d6ae08b0fe6fea Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 3 Oct 2018 14:49:14 +0200 Subject: [PATCH] rename check_available to assert_sid_unused Signed-off-by: Thomas Lamprecht --- PVE/API2/Disks/Directory.pm | 2 +- PVE/API2/Disks/LVM.pm | 2 +- PVE/API2/Disks/LVMThin.pm | 2 +- PVE/API2/Disks/ZFS.pm | 2 +- PVE/Storage.pm | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PVE/API2/Disks/Directory.pm b/PVE/API2/Disks/Directory.pm index d76cf10..27009f5 100644 --- a/PVE/API2/Disks/Directory.pm +++ b/PVE/API2/Disks/Directory.pm @@ -202,7 +202,7 @@ __PACKAGE__->register_method ({ $dev = PVE::Diskmanage::verify_blockdev_path($dev); PVE::Diskmanage::check_unused($dev); - PVE::Storage::check_available($name) if $param->{add_storage}; + PVE::Storage::assert_sid_unused($name) if $param->{add_storage}; my $worker = sub { my $path = "/mnt/pve/$name"; diff --git a/PVE/API2/Disks/LVM.pm b/PVE/API2/Disks/LVM.pm index 9556a24..7f8c319 100644 --- a/PVE/API2/Disks/LVM.pm +++ b/PVE/API2/Disks/LVM.pm @@ -150,7 +150,7 @@ __PACKAGE__->register_method ({ $dev = PVE::Diskmanage::verify_blockdev_path($dev); PVE::Diskmanage::check_unused($dev); - PVE::Storage::check_available($name) if $param->{add_storage}; + PVE::Storage::assert_sid_unused($name) if $param->{add_storage}; my $worker = sub { PVE::Diskmanage::locked_disk_action(sub { diff --git a/PVE/API2/Disks/LVMThin.pm b/PVE/API2/Disks/LVMThin.pm index 717897d..596d393 100644 --- a/PVE/API2/Disks/LVMThin.pm +++ b/PVE/API2/Disks/LVMThin.pm @@ -104,7 +104,7 @@ __PACKAGE__->register_method ({ $dev = PVE::Diskmanage::verify_blockdev_path($dev); PVE::Diskmanage::check_unused($dev); - PVE::Storage::check_available($name) if $param->{add_storage}; + PVE::Storage::assert_sid_unused($name) if $param->{add_storage}; my $worker = sub { PVE::Diskmanage::locked_disk_action(sub { diff --git a/PVE/API2/Disks/ZFS.pm b/PVE/API2/Disks/ZFS.pm index a44f573..f187eb2 100644 --- a/PVE/API2/Disks/ZFS.pm +++ b/PVE/API2/Disks/ZFS.pm @@ -344,7 +344,7 @@ __PACKAGE__->register_method ({ PVE::Diskmanage::check_unused($dev); } - PVE::Storage::check_available($name) if $param->{add_storage}; + PVE::Storage::assert_sid_unused($name) if $param->{add_storage}; my $numdisks = scalar(@$devs); my $mindisks = { diff --git a/PVE/Storage.pm b/PVE/Storage.pm index 81f9b67..3b92ee3 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -1648,12 +1648,12 @@ sub get_bandwidth_limit { } # checks if the storage id is available and dies if not -sub check_available { - my ($id) = @_; +sub assert_sid_unused { + my ($sid) = @_; my $cfg = config(); - if (my $scfg = storage_config($cfg, $id, 1)) { - die "storage ID '$id' already defined\n"; + if (my $scfg = storage_config($cfg, $sid, 1)) { + die "storage ID '$sid' already defined\n"; } return undef; -- 2.39.2