and use PVE::HA::Groups to parse the config when testing/simulating.
this allows us to drop the dependency on PVE::HA::Config, which would
otherwise pull in a lot of additional depdendencies that we don't want
in the simulator.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
use PVE::Cluster qw(cfs_register_file cfs_read_file cfs_write_file cfs_lock_file);
use PVE::HA::Resources;
-PVE::HA::Groups->register();
-
-PVE::HA::Groups->init();
-
my $manager_status_filename = "ha/manager_status";
my $ha_groups_config = "ha/groups.cfg";
my $ha_resources_config = "ha/resources.cfg";
return undef;
}
+__PACKAGE__->register();
+__PACKAGE__->init();
+
1;
use Fcntl qw(:DEFAULT :flock);
use File::Copy;
use File::Path qw(make_path remove_tree);
-use PVE::HA::Config;
use PVE::HA::FenceConfig;
+use PVE::HA::Groups;
my $watchdog_timeout = 60;
my $raw = '';
$raw = PVE::Tools::file_get_contents($filename) if -f $filename;
- return PVE::HA::Config::parse_groups_config($filename, $raw);
+ return PVE::HA::Groups->parse_config($filename, $raw);
}
sub read_service_status {
use lib '.';
use PVE::Tools;
-use PVE::HA::Config;
+use PVE::HA::Groups;
use PVE::HA::Sim::TestHardware;
sub show_usage {
use warnings;
use lib '..';
-use PVE::HA::Config;
+use PVE::HA::Groups;
use PVE::HA::Manager;
-my $groups = PVE::HA::Config::parse_groups_config("groups.tmp", <<EOD);
+my $groups = PVE::HA::Groups->parse_config("groups.tmp", <<EOD);
group: prefer_node1
nodes node1
EOD