public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH cluster 1/1] datacenter config: Actually write the replication config
Date: Fri, 18 Jul 2025 10:13:48 +0200	[thread overview]
Message-ID: <20250718081349.125228-2-m.sandoval@proxmox.com> (raw)
In-Reply-To: <20250718081349.125228-1-m.sandoval@proxmox.com>

We get the following error without this patch:

```
$ pvesh set /cluster/options
400 validation error in '/etc/pve/datacenter.cfg'
replication: type check ('string') failed - got HASH
```

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 src/PVE/DataCenterConfig.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/PVE/DataCenterConfig.pm b/src/PVE/DataCenterConfig.pm
index 3d15643..c6d56c1 100644
--- a/src/PVE/DataCenterConfig.pm
+++ b/src/PVE/DataCenterConfig.pm
@@ -615,6 +615,10 @@ sub write_datacenter_config {
         $cfg->{migration} = PVE::JSONSchema::print_property_string($migration, $migration_format);
     }
 
+    if (ref(my $replication = $cfg->{replication})) {
+        $cfg->{replication} = PVE::JSONSchema::print_property_string($replication, $replication_format);
+    }
+
     if (defined(my $next_id = $cfg->{'next-id'})) {
         $next_id = parse_property_string($next_id_format, $next_id) if !ref($next_id);
 
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2025-07-18  8:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-18  8:13 [pve-devel] [PATCH cluster/manager 0/2] ui: add datacenter replication network option Maximiliano Sandoval
2025-07-18  8:13 ` Maximiliano Sandoval [this message]
2025-07-18  9:59   ` [pve-devel] applied: [PATCH cluster 1/1] datacenter config: Actually write the replication config Thomas Lamprecht
2025-07-18  8:13 ` [pve-devel] [PATCH manager 1/1] ui: dc/options: allow to edit cluster wide replication settings Maximiliano Sandoval
2025-07-18 10:13   ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250718081349.125228-2-m.sandoval@proxmox.com \
    --to=m.sandoval@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal