[pve-devel] [PATCH v3 ha-manager 3/9] Implement update_service_config for simulation

Fabian Ebner f.ebner at proxmox.com
Wed Oct 2 11:46:04 CEST 2019


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

diff --git a/src/PVE/HA/Sim/Hardware.pm b/src/PVE/HA/Sim/Hardware.pm
index 9c0ad05..3cdc85b 100644
--- a/src/PVE/HA/Sim/Hardware.pm
+++ b/src/PVE/HA/Sim/Hardware.pm
@@ -109,6 +109,20 @@ sub read_service_config {
     return $conf;
 }
 
+sub update_service_config {
+    my ($self, $sid, $param) = @_;
+
+    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