]> git.proxmox.com Git - pve-common.git/commitdiff
SectionConfig: add new parameter $skip_type to createSchema()
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 20 Feb 2017 11:40:33 +0000 (12:40 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 20 Feb 2017 11:40:33 +0000 (12:40 +0100)
This is useful when there is only a single type of entries.

src/PVE/SectionConfig.pm

index bfe4f8b958aeeedd3d7ba3c0f90904846c8ae55d..e489b7c6f4e14eadb3227bb1114d4d2d2124535f 100644 (file)
@@ -51,7 +51,7 @@ sub plugindata {
 }   
 
 sub createSchema {
-    my ($class) = @_;
+    my ($class, $skip_type) = @_;
 
     my $pdata = $class->private();
     my $propertyList = $pdata->{propertyList};
@@ -71,6 +71,8 @@ sub createSchema {
     };
 
     foreach my $p (keys %$propertyList) {
+       next if $skip_type && $p eq 'type';
+
        if (!$propertyList->{$p}->{optional}) {
            $props->{$p} = $propertyList->{$p};
            next;