]> git.proxmox.com Git - pve-common.git/commitdiff
JSONSchema: extend pve-configid regex by '-'
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 9 Apr 2020 14:10:41 +0000 (16:10 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 23 Apr 2020 05:50:24 +0000 (07:50 +0200)
we use this format for all 'delete' options but we have some options
that have a '-' in the name (e.g. 'sync-defaults-options') that cannot
be deleted if it is not included

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PVE/JSONSchema.pm

index 01a3cce13bff8741bf76a3e0b01c32c75cb7ecc2..1d28f36510bab45b0ba58c4fb22478a3c870f4fe 100644 (file)
@@ -169,7 +169,7 @@ register_format('pve-configid', \&pve_verify_configid);
 sub pve_verify_configid {
     my ($id, $noerr) = @_;
 
-    if ($id !~ m/^[a-z][a-z0-9_]+$/i) {
+    if ($id !~ m/^[a-z][a-z0-9_-]+$/i) {
        return undef if $noerr;
        die "invalid configuration ID '$id'\n";
     }