From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: [pve-devel] applied: [PATCH pve-storage 2/2] clean: fix whitspaces and minor code issues
Date: Wed, 26 Jul 2023 14:31:09 +0200 [thread overview]
Message-ID: <1690374654.7rsfytsw5w.astroid@yuna.none> (raw)
In-Reply-To: <20230725143720.620577-3-p.hufnagl@proxmox.com>
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
>
> Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
> ---
> 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(-)
>
> 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 => 1,
> proxyto => 'node',
> parameters => {
> - additionalProperties => 0,
> + additionalProperties => 0,
> properties => {
> node => get_standard_option('pve-node'),
> storage => get_standard_option('pve-storage-id', {
> @@ -204,7 +204,7 @@ __PACKAGE__->register_method ({
> check => ['perm', '/storage/{storage}', ['Datastore.Audit', 'Datastore.AllocateSpace'], any => 1],
> },
> parameters => {
> - additionalProperties => 0,
> + additionalProperties => 0,
> properties => {
> node => get_standard_option('pve-node'),
> storage => get_standard_option('pve-storage-id'),
> @@ -248,7 +248,7 @@ __PACKAGE__->register_method ({
> protected => 1,
> proxyto => 'node',
> parameters => {
> - additionalProperties => 0,
> + additionalProperties => 0,
> properties => {
> node => get_standard_option('pve-node'),
> storage => get_standard_option('pve-storage-id'),
> @@ -284,7 +284,7 @@ __PACKAGE__->register_method ({
> protected => 1,
> proxyto => 'node',
> parameters => {
> - additionalProperties => 0,
> + additionalProperties => 0,
> properties => {
> node => get_standard_option('pve-node'),
> storage => get_standard_option('pve-storage-id'),
> @@ -295,11 +295,11 @@ __PACKAGE__->register_method ({
> },
> ds => {
> description => "The list of datasources you want to display.",
> - type => 'string', format => 'pve-configid-list',
> + type => 'string', format => 'pve-configid-list',
> },
> cf => {
> description => "The RRD consolidation function",
> - type => 'string',
> + type => 'string',
> enum => [ 'AVERAGE', 'MAX' ],
> optional => 1,
> },
> @@ -330,7 +330,7 @@ __PACKAGE__->register_method ({
> protected => 1,
> proxyto => 'node',
> parameters => {
> - additionalProperties => 0,
> + additionalProperties => 0,
> properties => {
> node => get_standard_option('pve-node'),
> storage => get_standard_option('pve-storage-id'),
> @@ -341,7 +341,7 @@ __PACKAGE__->register_method ({
> },
> cf => {
> description => "The RRD consolidation function",
> - type => 'string',
> + type => 'string',
> enum => [ 'AVERAGE', 'MAX' ],
> optional => 1,
> },
> @@ -374,7 +374,7 @@ __PACKAGE__->register_method ({
> },
> protected => 1,
> parameters => {
> - additionalProperties => 0,
> + additionalProperties => 0,
> properties => {
> node => get_standard_option('pve-node'),
> storage => 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;
>
> use strict;
> use warnings;
> -use Data::Dumper;
>
> use POSIX;
> use IO::Select;
> @@ -304,11 +303,11 @@ sub volume_resize {
>
> my ($storeid, $volname) = parse_volume_id($volid, 1);
> if ($storeid) {
> - my $scfg = storage_config($cfg, $storeid);
> - my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
> - return $plugin->volume_resize($scfg, $storeid, $volname, $size, $running);
> + my $scfg = storage_config($cfg, $storeid);
> + my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
> + return $plugin->volume_resize($scfg, $storeid, $volname, $size, $running);
> } elsif ($volid =~ 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 {
>
> my ($storeid, $volname) = parse_volume_id($volid, 1);
> if ($storeid) {
> - my $scfg = storage_config($cfg, $storeid);
> - my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
> - return $plugin->volume_rollback_is_possible($scfg, $storeid, $volname, $snap, $blockers);
> + my $scfg = storage_config($cfg, $storeid);
> + my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
> + return $plugin->volume_rollback_is_possible($scfg, $storeid, $volname, $snap, $blockers);
> } elsif ($volid =~ 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 {
>
> my ($storeid, $volname) = parse_volume_id($volid, 1);
> if ($storeid) {
> - my $scfg = storage_config($cfg, $storeid);
> - my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
> - return $plugin->volume_snapshot($scfg, $storeid, $volname, $snap);
> + my $scfg = storage_config($cfg, $storeid);
> + my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
> + return $plugin->volume_snapshot($scfg, $storeid, $volname, $snap);
> } elsif ($volid =~ 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 {
>
> my ($storeid, $volname) = parse_volume_id($volid, 1);
> if ($storeid) {
> - my $scfg = storage_config($cfg, $storeid);
> - my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
> + my $scfg = storage_config($cfg, $storeid);
> + my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
> $plugin->volume_rollback_is_possible($scfg, $storeid, $volname, $snap);
> - return $plugin->volume_snapshot_rollback($scfg, $storeid, $volname, $snap);
> + return $plugin->volume_snapshot_rollback($scfg, $storeid, $volname, $snap);
> } elsif ($volid =~ 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 {
>
> my ($storeid, $volname) = parse_volume_id($volid, 1);
> if ($storeid) {
> - my $scfg = storage_config($cfg, $storeid);
> - my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
> - return $plugin->volume_snapshot_delete($scfg, $storeid, $volname, $snap, $running);
> + my $scfg = storage_config($cfg, $storeid);
> + my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
> + return $plugin->volume_snapshot_delete($scfg, $storeid, $volname, $snap, $running);
> } elsif ($volid =~ 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 {
>
> my ($storeid, $volname) = parse_volume_id($volid, 1);
> if ($storeid) {
> - my $scfg = storage_config($cfg, $storeid);
> - my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
> - return $plugin->volume_has_feature($scfg, $feature, $storeid, $volname, $snap, $running, $opts);
> + my $scfg = storage_config($cfg, $storeid);
> + my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
> + return $plugin->volume_has_feature($scfg, $feature, $storeid, $volname, $snap, $running, $opts);
> } elsif ($volid =~ m|^(/.+)$| && -e $volid) {
> return undef;
> } else {
> @@ -1503,7 +1502,7 @@ sub foreach_volid {
>
> foreach my $sid (keys %$list) {
> foreach my $info (@{$list->{$sid}}) {
> - my $volid = $info->{volid};
> + my $volid = $info->{volid};
> my ($sid1, $volname) = parse_volume_id($volid, 1);
> if ($sid1 && $sid1 eq $sid) {
> &$func ($volid, $sid, $info);
> @@ -1849,7 +1848,7 @@ sub volume_export : prototype($$$$$$$) {
> my $scfg = storage_config($cfg, $storeid);
> my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
> return $plugin->volume_export($scfg, $storeid, $fh, $volname, $format,
> - $snapshot, $base_snapshot, $with_snapshots);
> + $snapshot, $base_snapshot, $with_snapshots);
> }
>
> sub volume_import : prototype($$$$$$$$) {
> @@ -1880,8 +1879,8 @@ sub volume_export_formats : prototype($$$$$) {
> my $scfg = storage_config($cfg, $storeid);
> my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
> return $plugin->volume_export_formats($scfg, $storeid, $volname,
> - $snapshot, $base_snapshot,
> - $with_snapshots);
> + $snapshot, $base_snapshot,
> + $with_snapshots);
> }
>
> 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 = sub {
>
> if ($tt eq 'iso') {
> next if $fn !~ m!/([^/]+$PVE::Storage::ISO_EXT_RE_0)$!i;
> -
> - $info = { volid => "$sid:iso/$1", format => 'iso' };
> + $info = { volid => "$sid:iso/$1", format => 'iso' };
>
> } elsif ($tt eq 'vztmpl') {
> next if $fn !~ m!/([^/]+$PVE::Storage::VZTMPL_EXT_RE_1)$!;
> --
> 2.39.2
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>
>
next prev parent reply other threads:[~2023-07-26 12:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-25 14:37 [pve-devel] [PATCH pve-storage/pve-manager 0/3] allow download of compressed ISOs Philipp Hufnagl
2023-07-25 14:37 ` [pve-devel] [PATCH pve-storage 1/2] fix #4849: download-url: allow download and decompression " Philipp Hufnagl
2023-07-26 12:31 ` Fabian Grünbichler
2023-07-25 14:37 ` [pve-devel] [PATCH pve-storage 2/2] clean: fix whitspaces and minor code issues Philipp Hufnagl
2023-07-26 12:31 ` Fabian Grünbichler [this message]
2023-07-25 14:37 ` [pve-devel] [PATCH pve-manager 1/1] fix #4849: download to storage: automatically detect and configure compression Philipp Hufnagl
2023-07-26 12:31 ` Fabian Grünbichler
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=1690374654.7rsfytsw5w.astroid@yuna.none \
--to=f.gruenbichler@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