[pve-devel] [PATCH manager 2/2] implement digest checking for ReplicationConfig update
Dominik Csapak
d.csapak at proxmox.com
Mon Jun 12 15:01:14 CEST 2017
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
PVE/API2/ReplicationConfig.pm | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/PVE/API2/ReplicationConfig.pm b/PVE/API2/ReplicationConfig.pm
index 5af9c3dc..51edff70 100644
--- a/PVE/API2/ReplicationConfig.pm
+++ b/PVE/API2/ReplicationConfig.pm
@@ -89,6 +89,8 @@ __PACKAGE__->register_method ({
$data->{id} = $param->{id};
+ $data->{digest} = $cfg->{digest};
+
return $data;
}});
@@ -157,10 +159,13 @@ __PACKAGE__->register_method ({
my ($param) = @_;
my $id = extract_param($param, 'id');
+ my $digest = extract_param($param, 'digest');
my $code = sub {
my $cfg = PVE::ReplicationConfig->new();
+ PVE::SectionConfig::assert_if_modified($cfg, $digest);
+
my $data = $cfg->{ids}->{$id};
die "no such job '$id'\n" if !$data;
--
2.11.0
More information about the pve-devel
mailing list