]> git.proxmox.com Git - pve-cluster.git/blobdiff - data/PVE/API2/ClusterConfig.pm
API: correctly propagate $@ with nested locks
[pve-cluster.git] / data / PVE / API2 / ClusterConfig.pm
index e7142b5455835efb1abadad3e27531b95f66b7ea..c13e4caeb8c0a9167ff8bdf837097218507976ca 100644 (file)
@@ -197,7 +197,11 @@ my $config_change_lock = sub {
        PVE::Cluster::cfs_update(1);
        my $members = PVE::Cluster::get_members();
        if (scalar(keys %$members) > 1) {
-           return PVE::Cluster::cfs_lock_file('corosync.conf', 10, $code);
+           my $res = PVE::Cluster::cfs_lock_file('corosync.conf', 10, $code);
+           # cfs_lock_file only sets $@
+           # lock_file does not propagate $@ unless we die here
+           die $@ if defined($@);
+           return $res;
        } else {
            return $code->();
        }