}
}
- $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',
foreach my $type (keys %$plugins) {
my $props = $plugins->{$type}->properties();
foreach my $p (keys %$props) {
- die "duplicate property" if defined($propertyList->{$p});
+ die "duplicate property '$p'" if defined($propertyList->{$p});
my $res = $propertyList->{$p} = {};
my $data = $props->{$p};
for my $a (keys %$data) {
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;