[pve-devel] [PATCH v2 ha-manager 04/12] Implement update_service_config for simulation

Fabian Ebner f.ebner at proxmox.com
Mon Sep 30 09:22:29 CEST 2019


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 src/PVE/HA/Sim/Hardware.pm | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/PVE/HA/Sim/Hardware.pm b/src/PVE/HA/Sim/Hardware.pm
index 8bd5cbd..d2c0ec0 100644
--- a/src/PVE/HA/Sim/Hardware.pm
+++ b/src/PVE/HA/Sim/Hardware.pm
@@ -109,6 +109,22 @@ sub read_service_config {
     return $conf;
 }
 
+sub update_service_config {
+    my ($self, $digest, $delete, $sid, $param) = @_;
+
+    die "not implemented" if ($digest || $delete);
+
+    my $conf = $self->read_service_config();
+
+    my $sconf = $conf->{$sid} || die "no such resource '$sid'\n";
+
+    foreach my $k (%$param) {
+	$sconf->{$k} = $param->{$k};
+    }
+
+    $self->write_service_config($conf);
+}
+
 sub write_service_config {
     my ($self, $conf) = @_;
 
-- 
2.20.1





More information about the pve-devel mailing list