all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [pve-network] d/postinst: do not break, if ipam-file moves fail
@ 2024-11-20 14:13 Stoiko Ivanov
  2024-11-20 15:25 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Stoiko Ivanov @ 2024-11-20 14:13 UTC (permalink / raw)
  To: pve-devel

failing a package-install does not help repairing the situation - so
inform the user about the issue instead of erroring out. The copy
could fail if a node is not quorate, so writes in /etc/pve are a bit
more likely to fail
adapts the change introduced in
d0628df ("debian: migrate legacy mac/ipam cache/state files")

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
noticed while looking at another small issue, and was reminded about the
recent change for ifupdown2:
https://lore.proxmox.com/pve-devel/20241113190113.678807-1-s.ivanov@proxmox.com/

 debian/libpve-network-perl.postinst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/libpve-network-perl.postinst b/debian/libpve-network-perl.postinst
index c28328d..99faedf 100644
--- a/debian/libpve-network-perl.postinst
+++ b/debian/libpve-network-perl.postinst
@@ -8,7 +8,7 @@ migrate_ipam_db() {
 
   if test -f "$LEGACY_IPAM_DB_FILE" && test ! -f "$IPAM_DB_FILE"; then
     echo "copying over existing legacy IPAM state file to new path..."
-    cp $LEGACY_IPAM_DB_FILE $IPAM_DB_FILE
+    cp $LEGACY_IPAM_DB_FILE $IPAM_DB_FILE || echo "copying IPAM state file failed!"
   fi
 }
 
@@ -18,7 +18,7 @@ migrate_mac_cache() {
 
   if test -f "$LEGACY_MAC_DB_FILE" && test ! -f "$MAC_DB_FILE"; then
     echo "copying over existing legacy IPAM MAC-map cache file to new path..."
-    cp $LEGACY_MAC_DB_FILE $MAC_DB_FILE
+    cp $LEGACY_MAC_DB_FILE $MAC_DB_FILE || echo "copying IPAM MAC-map cache file failed!"
   fi
 }
 
-- 
2.39.5



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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied:  [pve-network] d/postinst: do not break, if ipam-file moves fail
  2024-11-20 14:13 [pve-devel] [pve-network] d/postinst: do not break, if ipam-file moves fail Stoiko Ivanov
@ 2024-11-20 15:25 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2024-11-20 15:25 UTC (permalink / raw)
  To: Proxmox VE development discussion, Stoiko Ivanov

Am 20.11.24 um 15:13 schrieb Stoiko Ivanov:
> failing a package-install does not help repairing the situation - so
> inform the user about the issue instead of erroring out. The copy
> could fail if a node is not quorate, so writes in /etc/pve are a bit
> more likely to fail
> adapts the change introduced in
> d0628df ("debian: migrate legacy mac/ipam cache/state files")
> 
> Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
> ---
> noticed while looking at another small issue, and was reminded about the
> recent change for ifupdown2:
> https://lore.proxmox.com/pve-devel/20241113190113.678807-1-s.ivanov@proxmox.com/
> 
>  debian/libpve-network-perl.postinst | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
>

applied, thanks!


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-20 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-20 14:13 [pve-devel] [pve-network] d/postinst: do not break, if ipam-file moves fail Stoiko Ivanov
2024-11-20 15:25 ` [pve-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal