]> git.proxmox.com Git - pve-common.git/commitdiff
SectionConfig: disable duplicate plugin registration
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 26 Jan 2016 12:16:19 +0000 (13:16 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 26 Jan 2016 12:16:19 +0000 (13:16 +0100)
src/PVE/SectionConfig.pm

index 95e166abce88d8101368ee93213b7dda33532525..6f85b228b81ec82c77d64fbbbc8f0197e5274e01 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;