]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/SectionConfig.pm
SectionConfig.pm: sort type enum
[pve-common.git] / src / PVE / SectionConfig.pm
index 95e166abce88d8101368ee93213b7dda33532525..441e026fb1b3f98c75b3ac93d6546e11c15325fd 100644 (file)
@@ -26,6 +26,9 @@ sub register {
     my $type = $class->type();
     my $pdata = $class->private();
 
+    die "duplicate plugin registration (type = $type)"
+       if defined($pdata->{plugins}->{$type});
+
     my $plugindata = $class->plugindata();
     $pdata->{plugindata}->{$type} = $plugindata;
     $pdata->{plugins}->{$type} = $class;
@@ -181,7 +184,7 @@ sub init {
     }
 
     $propertyList->{type}->{type} = 'string';
-    $propertyList->{type}->{enum} = [keys %$plugins];
+    $propertyList->{type}->{enum} = [sort keys %$plugins];
 }
 
 sub lookup {