allows an API client to more easily differ between this OK "error"
and an actual exception.
Note that I'd rather now just return undef or an empty object for the
no cluster case (not to sure about the original reasons about the die
anymore), but that would be a breaking change, and in fact it would
break current pve-manager versions out there, so schedule that for
the next major release (if we still want it then)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE::Cluster::cfs_update(1);
my $conf = PVE::Cluster::cfs_read_file('corosync.conf');
- die "node is not in a cluster, no join info available!\n"
- if !($conf && $conf->{main});
+ # FIXME: just return undef or empty object in PVE 8.0 (check if manager can handle it!)
+ PVE::Exception::raise(
+ 'node is not in a cluster, no join info available!',
+ code => HTTP::Status::HTTP_FAILED_DEPENDENCY,
+ ) if !($conf && $conf->{main});
my $totem_cfg = $conf->{main}->{totem} // {};
my $nodelist = $conf->{main}->{nodelist}->{node} // {};