]>
git.proxmox.com Git - pve-ha-manager.git/blob - PVE/HA/Env.pm
8 # abstract out the cluster environment
11 my ($this, $statusdir) = @_;
13 my $class = ref($this) || $this;
16 statusdir
=> $statusdir,
22 sub read_local_status
{
25 return PVE
::Tools
::file_read_firstline
("$self->{statusdir}/status");
28 sub write_local_status
{
29 my ($self, $status) = @_;
31 PVE
::Tools
::file_set_contents
("$self->{statusdir}/status", $status);
34 # this should return a hash containing info
35 # what nodes are members and online.
41 # return { node1 => { online => 1, join_time => X }, node2 => ... }
45 my ($self, $level, $msg) = @_;
50 # aquire a cluster wide lock
51 sub get_ha_manager_lock
{
57 # return true when cluster is quorate
65 # overwrite that if you want to simulate
73 my ($self, $delay) = @_;