X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=data%2FPVE%2FSectionConfig.pm;h=5a6dcb1b16cb29c092c07ee979957c09db559c1b;hp=c338a9332d7c71e5b4a3e6c98a072cc2667eec52;hb=dc5eae7dbdfe5df7e4189e038945910c035715aa;hpb=212b08e8ec8115390aac7992be629eac19b22cd0 diff --git a/data/PVE/SectionConfig.pm b/data/PVE/SectionConfig.pm index c338a93..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', @@ -428,9 +423,7 @@ sub write_config { sub assert_if_modified { my ($cfg, $digest) = @_; - if ($digest && ($cfg->{digest} ne $digest)) { - die "detected modified configuration - file change by other user? Try again.\n"; - } + PVE::Tools::assert_if_modified($cfg->{digest}, $digest); } 1;