[pve-devel] [PATCH manager 11/14] ceph: mon destroy: refactor removal assertions

Dominik Csapak d.csapak at proxmox.com
Wed Jun 19 10:59:24 CEST 2019


On 6/18/19 3:42 PM, Dominik Csapak wrote:
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>   PVE/API2/Ceph/MON.pm | 19 +++++++++++++------
>   1 file changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/PVE/API2/Ceph/MON.pm b/PVE/API2/Ceph/MON.pm
> index 832a275e..2d116bb0 100644
> --- a/PVE/API2/Ceph/MON.pm
> +++ b/PVE/API2/Ceph/MON.pm
> @@ -73,6 +73,17 @@ my $assert_mon_prerequisites = sub {
>       }
>   };
>   
> +my $assert_mon_can_remove = sub {
> +    my ($monhash, $monlist, $monid) = @_;
> +
> +    die "no such monitor id '$monid'\n"
> +    if !defined($monhash->{"mon.$monid"}) &&
> +    !grep { $_->{name} && $_->{name} eq $monid } @$monlist;
> +
> +    -d $mondir || die "monitor filesystem '$mondir' does not exist on this node\n";
> +    die "can't remove last monitor\n" if scalar(@$monlist) <= 1;
> +};
> +

just fyi, there is an error here, because assert_mon_remove does not 
have the $mondir variable, seems something went wrong during my rebase
of my patches...

there should be another parameter '$mondir' (which of course is
given when this is called)

since i have to send a v2 anyway, please review this patch with
a fix in mind ;)




More information about the pve-devel mailing list