[pve-devel] applied: [PATCH v4 storage] deprecate mkdir option for create-base-path and create-subdirs

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Jun 5 11:40:52 CEST 2023


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.





More information about the pve-devel mailing list