]> git.proxmox.com Git - pve-common.git/commitdiff
register new standard option pve-config-digest
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 10 Apr 2014 07:47:04 +0000 (09:47 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 10 Apr 2014 07:47:04 +0000 (09:47 +0200)
data/PVE/JSONSchema.pm
data/PVE/SectionConfig.pm

index 94d2db23fd98d0bc81a88192f981d5c9b55860c3..3e0fd52c13f54d0eab19e49dac5eece2129c7c5b 100644 (file)
@@ -76,6 +76,13 @@ PVE::JSONSchema::register_standard_option('pve-storage-id', {
     type => 'string', format => 'pve-storage-id',
 }); 
 
+PVE::JSONSchema::register_standard_option('pve-config-digest', {
+    description => 'Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.',
+    type => 'string',
+    optional => 1,
+    maxLength => 40, # sha1 hex digest lenght is 40
+});
+
 my $format_list = {};
 
 sub register_format {
index f0bf23f86c9f90f761dc73a21eafd9342a47d6dd..5a6dcb1b16cb29c092c07ee979957c09db559c1b 100644 (file)
@@ -84,12 +84,7 @@ sub updateSchema {
        }
     }
 
-    $props->{digest} = {
-       type => 'string',
-       description => 'Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.',
-       maxLength => 40,
-       optional => 1,
-    };
+    $props->{digest} = get_standard_option('pve-config-digest');
 
     $props->{delete} = {
        type => 'string', format => 'pve-configid-list',