[pve-devel] applied: [pve-network] only parse version if local sdn file exists

Thomas Lamprecht t.lamprecht at proxmox.com
Tue May 5 18:27:02 CEST 2020


On 5/5/20 5:22 PM, Stoiko Ivanov wrote:
> if a file does not exist PVE::Tools::file_read_firstline returns undef.
> 
> This happens e.g. if you install the libpve-network-perl package before
> creating the local sdn file.
> 
> Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
> ---
> caught in my journal after installing updates today:
> May 05 17:17:20 rosa pvestatd[21735]: Use of uninitialized value $versionstr in pattern match (m//) at /usr/share/perl5/PVE/Network/SDN/Zones.pm line 141.
> 
>  PVE/Network/SDN/Zones.pm | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/PVE/Network/SDN/Zones.pm b/PVE/Network/SDN/Zones.pm
> index dbb1f30..2ca967f 100644
> --- a/PVE/Network/SDN/Zones.pm
> +++ b/PVE/Network/SDN/Zones.pm
> @@ -138,6 +138,9 @@ sub write_etc_network_config {
>  
>  sub read_etc_network_config_version {
>      my $versionstr = PVE::Tools::file_read_firstline($local_network_sdn_file);
> +
> +    return if !defined($versionstr);
> +
>      if ($versionstr =~ m/^\#version:(\d+)$/) {
>  	return $1;
>      }
> 

applied, thanks!




More information about the pve-devel mailing list