Manager: use absolute storage path

This helps to get things consistent on Windows and Linux. Otherwise a path
like `/some/path` is absolute on one platform but not on the other. This is
mostly for getting the unit tests in this package to work on Windows, but
using absolute paths also helps in clarity of error logging.
This commit is contained in:
Sybren A. Stüvel 2022-04-09 12:03:11 +02:00
parent 7f5978a0f2
commit 7a19e2f38d

View File

@ -245,6 +245,15 @@ func (c *Conf) processAfterLoading(override ...func(c *Conf)) {
} }
func (c *Conf) processStorage() { func (c *Conf) processStorage() {
storagePath, err := filepath.Abs(c.StoragePath)
if err != nil {
log.Error().Err(err).
Str("storage_path", c.StoragePath).
Msg("unable to determine absolute storage path")
} else {
c.StoragePath = storagePath
}
// Shaman should use the Flamenco storage location. // Shaman should use the Flamenco storage location.
if c.Shaman.Enabled { if c.Shaman.Enabled {
c.Shaman.StoragePath = c.StoragePath c.Shaman.StoragePath = c.StoragePath