public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: Aaron Lauterer <a.lauterer@proxmox.com>
Cc: pve-devel@lists.proxmox.com
Subject: [pve-devel] applied: [PATCH v4 storage] deprecate mkdir option for create-base-path and create-subdirs
Date: Mon, 5 Jun 2023 11:40:52 +0200	[thread overview]
Message-ID: <wwz5lnkygek33l7suke3pbf5h22r6z5fnrxxdz53xjt6olptiy@jwz5myhvdufw> (raw)
In-Reply-To: <20230531124609.928686-1-a.lauterer@proxmox.com>

applied with a small followup:

>  
> +sub config_aware_base_mkdir {
> +    my ($class, $scfg, $path) = @_;
> +
> +    # FIXME the mkdir parameter is deprecated and create-base-path should be used
> +    my $mkpath = 0;
> +    if (!defined($scfg->{'create-base-path'}) && !defined($scfg->{mkdir})) {
> +	$mkpath = 1;
> +    } elsif (defined($scfg->{'create-base-path'}) && $scfg->{'create-base-path'}) {
> +	$mkpath = 1;
> +    } elsif ($scfg->{mkdir}) {
> +	$mkpath = 1;
> +    }
> +    mkpath $path if $mkpath;
> +}
> +
>  1;
> -- 
> 2.30.2

I turned this logic into:
    $mkpath = $scfg->{'create-base-path'} // $scfg->{'mkdir'} // 1;

So the new option takes precedence and is honored if set to 0 (since the
above condition is `defined() && true => true`, but defined+false should
take precedence.




      reply	other threads:[~2023-06-05  9:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31 12:46 [pve-devel] " Aaron Lauterer
2023-06-05  9:40 ` Wolfgang Bumiller [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=wwz5lnkygek33l7suke3pbf5h22r6z5fnrxxdz53xjt6olptiy@jwz5myhvdufw \
    --to=w.bumiller@proxmox.com \
    --cc=a.lauterer@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