]> git.proxmox.com Git - pve-ha-manager.git/commitdiff
Resources: deny setting nonexistent group
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 20 Apr 2016 11:04:54 +0000 (13:04 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 20 Apr 2016 16:21:48 +0000 (18:21 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/API2/HA/Resources.pm

index 5fa970ee888167c162f2a46c05926642560ce107..621c9e6a004ee080f6104404b6e46c87e8dfb02a 100644 (file)
@@ -180,6 +180,13 @@ __PACKAGE__->register_method ({
            die "types does not match\n" if $param_type ne $type;
        }
 
+       if (my $group = $param->{group}) {
+           my $group_cfg = PVE::HA::Config::read_group_config();
+
+           die "HA group '$group' does not exist\n"
+               if !$group_cfg->{ids}->{$group};
+       }
+
        PVE::HA::Config::lock_ha_domain(
            sub {