From dc5eae7dbdfe5df7e4189e038945910c035715aa Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 10 Apr 2014 09:47:04 +0200 Subject: [PATCH] register new standard option pve-config-digest --- data/PVE/JSONSchema.pm | 7 +++++++ data/PVE/SectionConfig.pm | 7 +------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/data/PVE/JSONSchema.pm b/data/PVE/JSONSchema.pm index 94d2db2..3e0fd52 100644 --- a/data/PVE/JSONSchema.pm +++ b/data/PVE/JSONSchema.pm @@ -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 { diff --git a/data/PVE/SectionConfig.pm b/data/PVE/SectionConfig.pm index f0bf23f..5a6dcb1 100644 --- a/data/PVE/SectionConfig.pm +++ b/data/PVE/SectionConfig.pm @@ -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', -- 2.39.2