]> git.proxmox.com Git - pve-ha-manager.git/commitdiff
Groups: correctly set optional flag in propertyList
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 17 Sep 2015 09:53:44 +0000 (11:53 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 17 Sep 2015 09:53:44 +0000 (11:53 +0200)
Only group and type should be required, all other properties should
be marked optional inside propertyList. We can set correct values
for optional flag inside options().

src/PVE/HA/Groups.pm

index 0f0ddf9c7931aae26fa7b110ce868fc578841f2b..3b4338f1627533209c415221f27fb6c5ee82715c 100644 (file)
@@ -15,7 +15,7 @@ my $defaultData = {
        type => { description => "Section type." },
        group => get_standard_option('pve-ha-group-id',
                                    { completion => \&PVE::HA::Tools::complete_group }),
-       nodes => get_standard_option('pve-ha-group-node-list'),
+       nodes => get_standard_option('pve-ha-group-node-list', { optional => 1 }),
        restricted => {
            description => "Services on unrestricted groups may run on any cluster members if all group members are offline. But they will migrate back as soon as a group member comes online. One can implement a 'preferred node' behavior using an unrestricted group with one member.",
            type => 'boolean', 
@@ -43,7 +43,7 @@ sub type {
 
 sub options {
     return {
-       nodes => {},
+       nodes => { optional => 0 },
        comment => { optional => 1 },
        nofailback => { optional => 1 },
        restricted => { optional => 1 },