]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
ceph: fix version check shortcut
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 5 Nov 2021 14:23:47 +0000 (15:23 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 7 Nov 2021 20:03:13 +0000 (21:03 +0100)
with 'get_node_kv', we get a hash which contains the value for
all nodes in the cluster (with the nodename as key), so we have to use
the value from the hash corresponding to our nodename.

also the 'str' property is inside the 'version' hash

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/Ceph/Services.pm

index ad41dbe455520fb454421cc5bc2b69eb27cbc5db..5340f5fcbb7d54b524eeb392c5866605b6435d3a 100644 (file)
@@ -52,9 +52,10 @@ sub broadcast_ceph_versions {
 
     if ($version) {
        if (my $old = PVE::Cluster::get_node_kv("ceph-versions")) {
-           $old = eval { decode_json($old) };
+           my $nodename = PVE::INotify::nodename();
+           $old = eval { decode_json($old->{$nodename}) };
            warn $@ if $@; # should not happen
-           if (defined($old) && $old->{buildcommit} eq $buildcommit && $old->{str} eq $version) {
+           if (defined($old) && $old->{buildcommit} eq $buildcommit && $old->{version}->{str} eq $version) {
                return; # up to date, nothing to do so avoid (not exactly cheap) broadcast
            }
        }