all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH pve-common v2] cli: fix #6762: only copy properties if defined
@ 2025-10-07 15:16 Nicolas Frey
  2025-10-08 19:41 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Frey @ 2025-10-07 15:16 UTC (permalink / raw)
  To: pve-devel

Adds a defined check to the copy, as to not result in the following
error: 

~# pveceph status Can't use an undefined value as a HASH reference at
     /usr/share/perl5/PVE/CLIHandler.pm line 455, <DATA> line 960.

Pressing double tab after status produces the above message.

Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=6762
Signed-off-by: Nicolas Frey <n.frey@proxmox.com>
---
 src/PVE/CLIHandler.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm
index 89cb7b7..93b6d78 100644
--- a/src/PVE/CLIHandler.pm
+++ b/src/PVE/CLIHandler.pm
@@ -455,7 +455,10 @@ my $print_bash_completion = sub {
 
     my $info = $class->map_method_by_name($name);
 
-    my $prop = { %{ $info->{parameters}->{properties} } }; # copy
+    my $prop;
+    if (defined(my $properties = $info->{parameters}->{properties})) {
+        $prop = { $properties->%* }; # clone
+    }
     $prop = { %$prop, %$formatter_properties } if $formatter_properties;
 
     my $print_parameter_completion = sub {
-- 
2.47.3


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH pve-common v2] cli: fix #6762: only copy properties if defined
  2025-10-07 15:16 [pve-devel] [PATCH pve-common v2] cli: fix #6762: only copy properties if defined Nicolas Frey
@ 2025-10-08 19:41 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2025-10-08 19:41 UTC (permalink / raw)
  To: pve-devel, Nicolas Frey

On Tue, 07 Oct 2025 17:16:49 +0200, Nicolas Frey wrote:
> Adds a defined check to the copy, as to not result in the following
> error:
> 
> ~# pveceph status Can't use an undefined value as a HASH reference at
>      /usr/share/perl5/PVE/CLIHandler.pm line 455, <DATA> line 960.
> 
> Pressing double tab after status produces the above message.
> 
> [...]

Applied, thanks!

[1/1] cli: fix #6762: only copy properties if defined
      commit: dcf1836b6844976d60b71d0655b926cc1bdf2fe9


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-08 19:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-07 15:16 [pve-devel] [PATCH pve-common v2] cli: fix #6762: only copy properties if defined Nicolas Frey
2025-10-08 19:41 ` [pve-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal