In a previous commit we already added the openfabric / ospf
configuration files, but the configuration format changed since then,
so we replace them with the single configuration file used by the
fabrics now.

Also add a postinst script that removes the leftover folder from that
change.

Signed-off-by: Stefan Hanreich <s.hanre...@proxmox.com>
---
 debian/pve-cluster.postinst | 24 ++++++++++++++++++++++++
 src/PVE/Cluster.pm          |  3 +--
 src/pmxcfs/status.c         |  3 +--
 3 files changed, 26 insertions(+), 4 deletions(-)
 create mode 100644 debian/pve-cluster.postinst

diff --git a/debian/pve-cluster.postinst b/debian/pve-cluster.postinst
new file mode 100644
index 0000000..5ca091d
--- /dev/null
+++ b/debian/pve-cluster.postinst
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -e
+
+remove_fabrics_directory() {
+  LEGACY_FABRICS_DIRECTORY="/etc/pve/sdn/fabrics/"
+
+  if test -d "$LEGACY_FABRICS_DIRECTORY"; then
+    echo "Removing legacy sdn fabrics directory ..."
+    rm -d $LEGACY_FABRICS_DIRECTORY || echo "Failed to remove legacy sdn 
folder ${LEGACY_FABRICS_DIRECTORY}!"
+  fi
+}
+
+case "$1" in
+  configure)
+    # TODO: remove with PVE 10+
+    if dpkg --compare-versions "$2" 'lt' '9.0.0'; then
+      remove_fabrics_directory
+    fi
+  ;;
+esac
+
+exit 0
+
diff --git a/src/PVE/Cluster.pm b/src/PVE/Cluster.pm
index 0c78e65..d400620 100644
--- a/src/PVE/Cluster.pm
+++ b/src/PVE/Cluster.pm
@@ -81,8 +81,7 @@ my $observed = {
     'sdn/pve-ipam-state.json' => 1,
     'sdn/mac-cache.json' => 1,
     'sdn/dns.cfg' => 1,
-    'sdn/fabrics/openfabric.cfg' => 1,
-    'sdn/fabrics/ospf.cfg' => 1,
+    'sdn/fabrics.cfg' => 1,
     'sdn/.running-config' => 1,
     'virtual-guest/cpu-models.conf' => 1,
     'virtual-guest/profiles.cfg' => 1,
diff --git a/src/pmxcfs/status.c b/src/pmxcfs/status.c
index cda3921..2a2f673 100644
--- a/src/pmxcfs/status.c
+++ b/src/pmxcfs/status.c
@@ -110,8 +110,7 @@ static memdb_change_t memdb_change_array[] = {
        { .path = "sdn/mac-cache.json" },
        { .path = "sdn/pve-ipam-state.json" },
        { .path = "sdn/dns.cfg" },
-       { .path = "sdn/fabrics/openfabric.cfg" },
-       { .path = "sdn/fabrics/ospf.cfg" },
+       { .path = "sdn/fabrics.cfg" },
        { .path = "sdn/.running-config" },
        { .path = "virtual-guest/cpu-models.conf" },
        { .path = "virtual-guest/profiles.cfg" },
-- 
2.39.5


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

Reply via email to