public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Aaron Lauterer <a.lauterer@proxmox.com>,
	Dominik Csapak <d.csapak@proxmox.com>
Subject: Re: [pve-devel] [PATCH storage] rbd: fix #4060 show data-pool usage when configured
Date: Wed, 18 May 2022 08:19:19 +0200	[thread overview]
Message-ID: <7a0f6301-98b1-e40a-3586-606b06e4ec87@proxmox.com> (raw)
In-Reply-To: <f3b9e31f-71e0-b69a-f833-feb08eac1296@proxmox.com>

Am 5/17/22 um 16:07 schrieb Aaron Lauterer:
>>> diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
>>> index fb48c3f..da28e8a 100644
>>> --- a/PVE/Storage/RBDPlugin.pm
>>> +++ b/PVE/Storage/RBDPlugin.pm
>>> @@ -630,7 +630,8 @@ sub status {
>>>       my $rados = $librados_connect->($scfg, $storeid);
>>>       my $df = $rados->mon_command({ prefix => 'df', format => 'json' });
>>> -    my $pool =  $scfg->{pool} ? $scfg->{pool} : 'rbd';
>>> +    my $pool = $scfg->{'data-pool'} ? $scfg->{'data-pool'} : $scfg->{pool};
>>> +    $pool = 'rbd' if !$pool;
>>>       my ($d) = grep { $_->{name} eq $pool } @{$df->{pools}};
>>
>> without looking more closely at the surrounding code and how we
>> set/get those properties, wouldn't it also possble to do:
>>
>> my $pool = $scfg->{'data-pool'} // $scfg->{pool} // 'rbd';
>>
>> ?
> 
> Should work as well if it is okay stylewise. In the end, we want to get the pool name in that order.

Dominik's proposal would be fine(r) for me style wise.

      reply	other threads:[~2022-05-18  6:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 12:58 Aaron Lauterer
2022-05-17 14:01 ` Dominik Csapak
2022-05-17 14:07   ` Aaron Lauterer
2022-05-18  6:19     ` Thomas Lamprecht [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a0f6301-98b1-e40a-3586-606b06e4ec87@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=a.lauterer@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal