mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-07 08:16:25 +00:00
api: ceph monitor: rework some code style to modern
Signed-off-by: Max Carrara <m.carrara@proxmox.com> [ TL: also improve if-expression wrapping ] Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
bacedc4e9b
commit
50ae86b758
@ -147,14 +147,15 @@ my $assert_mon_prerequisites = sub {
|
|||||||
my $assert_mon_can_remove = sub {
|
my $assert_mon_can_remove = sub {
|
||||||
my ($monhash, $monlist, $monid, $mondir) = @_;
|
my ($monhash, $monlist, $monid, $mondir) = @_;
|
||||||
|
|
||||||
if (!(defined($monhash->{$monid}) ||
|
if (
|
||||||
grep { defined($_->{name}) && $_->{name} eq $monid } @$monlist))
|
!defined($monhash->{$monid} ||
|
||||||
{
|
grep { defined($_->{name}) && $_->{name} eq $monid } $monlist->@*)
|
||||||
|
) {
|
||||||
die "no such monitor id '$monid'\n"
|
die "no such monitor id '$monid'\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
die "monitor filesystem '$mondir' does not exist on this node\n" if ! -d $mondir;
|
die "monitor filesystem '$mondir' does not exist on this node\n" if ! -d $mondir;
|
||||||
die "can't remove last monitor\n" if scalar(@$monlist) <= 1;
|
die "can't remove last monitor\n" if scalar($monlist->@*) <= 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
my $remove_addr_from_mon_host = sub {
|
my $remove_addr_from_mon_host = sub {
|
||||||
|
Loading…
Reference in New Issue
Block a user