Open bile0026 opened 4 months ago
That's unexpected. This is due to this behavior in os.path.join
:
Help on function join in module posixpath:
join(a, *p)
Join two or more pathname components, inserting '/' as needed.
If any component is an absolute path, all previous path components
will be discarded. An empty last part will result in a path that
ends with a separator.
Environment
Expected Behavior
Backups should be able to be saved to the filesystem and saved to Git
Observed Behavior
Received an error
BACKUP CONFIG failed: Subtask: SAVE BACKUP CONFIGURATION TO FILE (failed)
. This appeared to be due to having a leading/
in my backup config path in Golden Config Settings, which I'm assuming was referencing the root of the filesystem. Since Nautobot doesn't run as root it doesn't have access to/
in the filesystem.Steps to Reproduce
/
in the path for backup, intended, or template settings in Golden Config settings for a given device.Proposed solutions
/
is detected in the settings page or when the settings are created/updated. i.e. "You have a leading/
in your configuration, is this expected?"/
when the settings are created/updated. This could limit some customer implementations if they are actually storing backups in a root directory that Nautobot does have access to.