]> git.proxmox.com Git - pve-common.git/commitdiff
section config: allow base properties for {create, update}Schema()
authorChristoph Heiss <c.heiss@proxmox.com>
Thu, 10 Aug 2023 12:37:06 +0000 (14:37 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 11 Aug 2023 11:22:16 +0000 (13:22 +0200)
This works the same way as e.g. get_standard_option does it.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
src/PVE/SectionConfig.pm

index 97492db6289e8474b17699b55956b850876249fd..2b75e6a8cc94d0737a18743625b0b0ca895d6079 100644 (file)
@@ -52,13 +52,13 @@ sub plugindata {
 }
 
 sub createSchema {
-    my ($class, $skip_type) = @_;
+    my ($class, $skip_type, $base) = @_;
 
     my $pdata = $class->private();
     my $propertyList = $pdata->{propertyList};
     my $plugins = $pdata->{plugins};
 
-    my $props = {};
+    my $props = $base || {};
 
     my $copy_property = sub {
        my ($src) = @_;
@@ -107,13 +107,13 @@ sub createSchema {
 }
 
 sub updateSchema {
-    my ($class, $single_class) = @_;
+    my ($class, $single_class, $base) = @_;
 
     my $pdata = $class->private();
     my $propertyList = $pdata->{propertyList};
     my $plugins = $pdata->{plugins};
 
-    my $props = {};
+    my $props = $base || {};
 
     my $filter_type = $single_class ? $class->type() : undef;