all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] fix #3440: influxdb: remove duplicate vmid tag
@ 2021-05-25 13:27 Lorenz Stechauner
  2021-05-26  7:46 ` Fabian Ebner
  0 siblings, 1 reply; 2+ messages in thread
From: Lorenz Stechauner @ 2021-05-25 13:27 UTC (permalink / raw)
  To: pve-devel

remove vmid from data part, it is already contained in object part.

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
---
Tested with local udp listener. works as expected.

 PVE/Status/InfluxDB.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/PVE/Status/InfluxDB.pm b/PVE/Status/InfluxDB.pm
index 9e4b0d96..c50aa9c8 100644
--- a/PVE/Status/InfluxDB.pm
+++ b/PVE/Status/InfluxDB.pm
@@ -94,6 +94,8 @@ sub update_qemu_status {
     }
     $object =~ s/\s/\\ /g;
 
+    # Duplicate keys may result in unwanted behavior
+    delete $data->{vmid};
     build_influxdb_payload($class, $txn, $data, $ctime, $object);
 }
 
@@ -108,6 +110,8 @@ sub update_lxc_status {
     }
     $object =~ s/\s/\\ /g;
 
+    # Duplicate keys may result in unwanted behavior
+    delete $data->{vmid};
     build_influxdb_payload($class, $txn, $data, $ctime, $object);
 }
 
-- 
2.20.1





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

* Re: [pve-devel] [PATCH manager] fix #3440: influxdb: remove duplicate vmid tag
  2021-05-25 13:27 [pve-devel] [PATCH manager] fix #3440: influxdb: remove duplicate vmid tag Lorenz Stechauner
@ 2021-05-26  7:46 ` Fabian Ebner
  0 siblings, 0 replies; 2+ messages in thread
From: Fabian Ebner @ 2021-05-26  7:46 UTC (permalink / raw)
  To: pve-devel, l.stechauner

Am 25.05.21 um 15:27 schrieb Lorenz Stechauner:
> remove vmid from data part, it is already contained in object part.
> 
> Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
> ---
> Tested with local udp listener. works as expected.
> 
>   PVE/Status/InfluxDB.pm | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/PVE/Status/InfluxDB.pm b/PVE/Status/InfluxDB.pm
> index 9e4b0d96..c50aa9c8 100644
> --- a/PVE/Status/InfluxDB.pm
> +++ b/PVE/Status/InfluxDB.pm
> @@ -94,6 +94,8 @@ sub update_qemu_status {
>       }
>       $object =~ s/\s/\\ /g;
>   
> +    # Duplicate keys may result in unwanted behavior
> +    delete $data->{vmid};

Note that this modifies $data for the caller as well, because it's a 
hash reference. Might not be a problem here (didn't check), but such 
things can lead to subtle (future) errors, so maybe there's a better 
alternative?

>       build_influxdb_payload($class, $txn, $data, $ctime, $object);
>   }
>   
> @@ -108,6 +110,8 @@ sub update_lxc_status {
>       }
>       $object =~ s/\s/\\ /g;
>   
> +    # Duplicate keys may result in unwanted behavior
> +    delete $data->{vmid};
>       build_influxdb_payload($class, $txn, $data, $ctime, $object);
>   }
>   
> 




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

end of thread, other threads:[~2021-05-26  7:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 13:27 [pve-devel] [PATCH manager] fix #3440: influxdb: remove duplicate vmid tag Lorenz Stechauner
2021-05-26  7:46 ` Fabian Ebner

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