Use the same expression as in the OK(()) branch after the do_rrd_migration() call. Previously, the presence of a nonexistent node would lead to a failure:
> Error migrating nodes: Not a directory (os error 20) That is because the path would have a duplicate node name attached, for example: > /var/lib/rrdcached/db/pve2-node/nonexistent/nonexistent Fixing that alone is not enough, there also was a 'continue' missing to avoid calling do_rrd_migration() with the old node, i.e. to actually skip it. Signed-off-by: Fiona Ebner <f.eb...@proxmox.com> --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index fb58d3a..9afd48b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -528,10 +528,11 @@ fn migrate_nodes( if !resource_present(format!("{resources}/.members").as_str(), node.as_str())? { if migrate { println!("Node: '{node}' not present. Skip and mark as old."); - mv_old(format!("{}/{node}", file.0.to_string_lossy()).as_str())?; + mv_old(full_path.as_str())?; } else { println!("Node: '{node}' not present. Would mark as old, but in dry-run mode, so just skip."); } + continue; } match do_rrd_migration( file, -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel