From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 9CA1261A63 for ; Wed, 26 Jul 2023 14:31:19 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 732CA61B8 for ; Wed, 26 Jul 2023 14:31:19 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Wed, 26 Jul 2023 14:31:17 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id B01434538F for ; Wed, 26 Jul 2023 14:31:17 +0200 (CEST) Date: Wed, 26 Jul 2023 14:31:09 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20230725143720.620577-1-p.hufnagl@proxmox.com> <20230725143720.620577-3-p.hufnagl@proxmox.com> In-Reply-To: <20230725143720.620577-3-p.hufnagl@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1690374654.7rsfytsw5w.astroid@yuna.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.070 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com, plugin.pm, storage.pm, status.pm] Subject: [pve-devel] applied: [PATCH pve-storage 2/2] clean: fix whitspaces and minor code issues X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jul 2023 12:31:19 -0000 applied this one already, with a small fixup folded in. On July 25, 2023 4:37 pm, Philipp Hufnagl wrote: > removed Data::Dumper and a newline >=20 > Signed-off-by: Philipp Hufnagl > --- > src/PVE/API2/Storage/Status.pm | 18 +++++------ > src/PVE/Storage.pm | 55 +++++++++++++++++----------------- > src/PVE/Storage/Plugin.pm | 3 +- > 3 files changed, 37 insertions(+), 39 deletions(-) >=20 > diff --git a/src/PVE/API2/Storage/Status.pm b/src/PVE/API2/Storage/Status= .pm > index 9ac4660..51e519e 100644 > --- a/src/PVE/API2/Storage/Status.pm > +++ b/src/PVE/API2/Storage/Status.pm > @@ -53,7 +53,7 @@ __PACKAGE__->register_method ({ > protected =3D> 1, > proxyto =3D> 'node', > parameters =3D> { > - additionalProperties =3D> 0, > + additionalProperties =3D> 0, > properties =3D> { > node =3D> get_standard_option('pve-node'), > storage =3D> get_standard_option('pve-storage-id', { > @@ -204,7 +204,7 @@ __PACKAGE__->register_method ({ > check =3D> ['perm', '/storage/{storage}', ['Datastore.Audit', 'Datastor= e.AllocateSpace'], any =3D> 1], > }, > parameters =3D> { > - additionalProperties =3D> 0, > + additionalProperties =3D> 0, > properties =3D> { > node =3D> get_standard_option('pve-node'), > storage =3D> get_standard_option('pve-storage-id'), > @@ -248,7 +248,7 @@ __PACKAGE__->register_method ({ > protected =3D> 1, > proxyto =3D> 'node', > parameters =3D> { > - additionalProperties =3D> 0, > + additionalProperties =3D> 0, > properties =3D> { > node =3D> get_standard_option('pve-node'), > storage =3D> get_standard_option('pve-storage-id'), > @@ -284,7 +284,7 @@ __PACKAGE__->register_method ({ > protected =3D> 1, > proxyto =3D> 'node', > parameters =3D> { > - additionalProperties =3D> 0, > + additionalProperties =3D> 0, > properties =3D> { > node =3D> get_standard_option('pve-node'), > storage =3D> get_standard_option('pve-storage-id'), > @@ -295,11 +295,11 @@ __PACKAGE__->register_method ({ > }, > ds =3D> { > description =3D> "The list of datasources you want to display.", > - type =3D> 'string', format =3D> 'pve-configid-list', > + type =3D> 'string', format =3D> 'pve-configid-list', > }, > cf =3D> { > description =3D> "The RRD consolidation function", > - type =3D> 'string', > + type =3D> 'string', > enum =3D> [ 'AVERAGE', 'MAX' ], > optional =3D> 1, > }, > @@ -330,7 +330,7 @@ __PACKAGE__->register_method ({ > protected =3D> 1, > proxyto =3D> 'node', > parameters =3D> { > - additionalProperties =3D> 0, > + additionalProperties =3D> 0, > properties =3D> { > node =3D> get_standard_option('pve-node'), > storage =3D> get_standard_option('pve-storage-id'), > @@ -341,7 +341,7 @@ __PACKAGE__->register_method ({ > }, > cf =3D> { > description =3D> "The RRD consolidation function", > - type =3D> 'string', > + type =3D> 'string', > enum =3D> [ 'AVERAGE', 'MAX' ], > optional =3D> 1, > }, > @@ -374,7 +374,7 @@ __PACKAGE__->register_method ({ > }, > protected =3D> 1, > parameters =3D> { > - additionalProperties =3D> 0, > + additionalProperties =3D> 0, > properties =3D> { > node =3D> get_standard_option('pve-node'), > storage =3D> get_standard_option('pve-storage-id'), > diff --git a/src/PVE/Storage.pm b/src/PVE/Storage.pm > index 0c62cc8..4f72790 100755 > --- a/src/PVE/Storage.pm > +++ b/src/PVE/Storage.pm > @@ -2,7 +2,6 @@ package PVE::Storage; > =20 > use strict; > use warnings; > -use Data::Dumper; > =20 > use POSIX; > use IO::Select; > @@ -304,11 +303,11 @@ sub volume_resize { > =20 > my ($storeid, $volname) =3D parse_volume_id($volid, 1); > if ($storeid) { > - my $scfg =3D storage_config($cfg, $storeid); > - my $plugin =3D PVE::Storage::Plugin->lookup($scfg->{type}); > - return $plugin->volume_resize($scfg, $storeid, $volname, $size, = $running); > + my $scfg =3D storage_config($cfg, $storeid); > + my $plugin =3D PVE::Storage::Plugin->lookup($scfg->{type}); > + return $plugin->volume_resize($scfg, $storeid, $volname, $size, $runnin= g); > } elsif ($volid =3D~ m|^(/.+)$| && -e $volid) { > - die "resize file/device '$volid' is not possible\n"; > + die "resize file/device '$volid' is not possible\n"; > } else { > die "unable to parse volume ID '$volid'\n"; > } > @@ -319,11 +318,11 @@ sub volume_rollback_is_possible { > =20 > my ($storeid, $volname) =3D parse_volume_id($volid, 1); > if ($storeid) { > - my $scfg =3D storage_config($cfg, $storeid); > - my $plugin =3D PVE::Storage::Plugin->lookup($scfg->{type}); > - return $plugin->volume_rollback_is_possible($scfg, $storeid, $vo= lname, $snap, $blockers); > + my $scfg =3D storage_config($cfg, $storeid); > + my $plugin =3D PVE::Storage::Plugin->lookup($scfg->{type}); > + return $plugin->volume_rollback_is_possible($scfg, $storeid, $volname, = $snap, $blockers); > } elsif ($volid =3D~ m|^(/.+)$| && -e $volid) { > - die "snapshot rollback file/device '$volid' is not possible\n"; > + die "snapshot rollback file/device '$volid' is not possible\n"; > } else { > die "unable to parse volume ID '$volid'\n"; > } > @@ -334,11 +333,11 @@ sub volume_snapshot { > =20 > my ($storeid, $volname) =3D parse_volume_id($volid, 1); > if ($storeid) { > - my $scfg =3D storage_config($cfg, $storeid); > - my $plugin =3D PVE::Storage::Plugin->lookup($scfg->{type}); > - return $plugin->volume_snapshot($scfg, $storeid, $volname, $snap= ); > + my $scfg =3D storage_config($cfg, $storeid); > + my $plugin =3D PVE::Storage::Plugin->lookup($scfg->{type}); > + return $plugin->volume_snapshot($scfg, $storeid, $volname, $snap); > } elsif ($volid =3D~ m|^(/.+)$| && -e $volid) { > - die "snapshot file/device '$volid' is not possible\n"; > + die "snapshot file/device '$volid' is not possible\n"; > } else { > die "unable to parse volume ID '$volid'\n"; > } > @@ -349,12 +348,12 @@ sub volume_snapshot_rollback { > =20 > my ($storeid, $volname) =3D parse_volume_id($volid, 1); > if ($storeid) { > - my $scfg =3D storage_config($cfg, $storeid); > - my $plugin =3D PVE::Storage::Plugin->lookup($scfg->{type}); > + my $scfg =3D storage_config($cfg, $storeid); > + my $plugin =3D PVE::Storage::Plugin->lookup($scfg->{type}); > $plugin->volume_rollback_is_possible($scfg, $storeid, $volname, $snap); > - return $plugin->volume_snapshot_rollback($scfg, $storeid, $volna= me, $snap); > + return $plugin->volume_snapshot_rollback($scfg, $storeid, $volname, $sn= ap); > } elsif ($volid =3D~ m|^(/.+)$| && -e $volid) { > - die "snapshot rollback file/device '$volid' is not possible\n"; > + die "snapshot rollback file/device '$volid' is not possible\n"; > } else { > die "unable to parse volume ID '$volid'\n"; > } > @@ -366,11 +365,11 @@ sub volume_snapshot_delete { > =20 > my ($storeid, $volname) =3D parse_volume_id($volid, 1); > if ($storeid) { > - my $scfg =3D storage_config($cfg, $storeid); > - my $plugin =3D PVE::Storage::Plugin->lookup($scfg->{type}); > - return $plugin->volume_snapshot_delete($scfg, $storeid, $volname= , $snap, $running); > + my $scfg =3D storage_config($cfg, $storeid); > + my $plugin =3D PVE::Storage::Plugin->lookup($scfg->{type}); > + return $plugin->volume_snapshot_delete($scfg, $storeid, $volname, $snap= , $running); > } elsif ($volid =3D~ m|^(/.+)$| && -e $volid) { > - die "snapshot delete file/device '$volid' is not possible\n"; > + die "snapshot delete file/device '$volid' is not possible\n"; > } else { > die "unable to parse volume ID '$volid'\n"; > } > @@ -409,9 +408,9 @@ sub volume_has_feature { > =20 > my ($storeid, $volname) =3D parse_volume_id($volid, 1); > if ($storeid) { > - my $scfg =3D storage_config($cfg, $storeid); > - my $plugin =3D PVE::Storage::Plugin->lookup($scfg->{type}); > - return $plugin->volume_has_feature($scfg, $feature, $storeid, $v= olname, $snap, $running, $opts); > + my $scfg =3D storage_config($cfg, $storeid); > + my $plugin =3D PVE::Storage::Plugin->lookup($scfg->{type}); > + return $plugin->volume_has_feature($scfg, $feature, $storeid, $volname,= $snap, $running, $opts); > } elsif ($volid =3D~ m|^(/.+)$| && -e $volid) { > return undef; > } else { > @@ -1503,7 +1502,7 @@ sub foreach_volid { > =20 > foreach my $sid (keys %$list) { > foreach my $info (@{$list->{$sid}}) { > - my $volid =3D $info->{volid}; > + my $volid =3D $info->{volid}; > my ($sid1, $volname) =3D parse_volume_id($volid, 1); > if ($sid1 && $sid1 eq $sid) { > &$func ($volid, $sid, $info); > @@ -1849,7 +1848,7 @@ sub volume_export : prototype($$$$$$$) { > my $scfg =3D storage_config($cfg, $storeid); > my $plugin =3D PVE::Storage::Plugin->lookup($scfg->{type}); > return $plugin->volume_export($scfg, $storeid, $fh, $volname, $forma= t, > - $snapshot, $base_snapshot, $with_snaps= hots); > + $snapshot, $base_snapshot, $with_snapshots); > } > =20 > sub volume_import : prototype($$$$$$$$) { > @@ -1880,8 +1879,8 @@ sub volume_export_formats : prototype($$$$$) { > my $scfg =3D storage_config($cfg, $storeid); > my $plugin =3D PVE::Storage::Plugin->lookup($scfg->{type}); > return $plugin->volume_export_formats($scfg, $storeid, $volname, > - $snapshot, $base_snapshot, > - $with_snapshots); > + $snapshot, $base_snapshot, > + $with_snapshots); > } > =20 > sub volume_import_formats : prototype($$$$$) { > diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm > index 9d3b1ae..2e75a2b 100644 > --- a/src/PVE/Storage/Plugin.pm > +++ b/src/PVE/Storage/Plugin.pm > @@ -1226,8 +1226,7 @@ my $get_subdir_files =3D sub { > =20 > if ($tt eq 'iso') { > next if $fn !~ m!/([^/]+$PVE::Storage::ISO_EXT_RE_0)$!i; > - > - $info =3D { volid =3D> "$sid:iso/$1", format =3D> 'iso' }; > + $info =3D { volid =3D> "$sid:iso/$1", format =3D> 'iso' }; > =20 > } elsif ($tt eq 'vztmpl') { > next if $fn !~ m!/([^/]+$PVE::Storage::VZTMPL_EXT_RE_1)$!; > --=20 > 2.39.2 >=20 >=20 >=20 > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel >=20 >=20 >=20