diff --git a/clab/clab.go b/clab/clab.go index 614e086ac..01faf083a 100644 --- a/clab/clab.go +++ b/clab/clab.go @@ -154,7 +154,7 @@ func (c *CLab) ProcessTopoPath(path string) (string, error) { } // if the path is not a local file and a URL, download the file and store it in the tmp dir case !utils.FileOrDirExists(path) && utils.IsHttpURL(path, true): - file, err = downloadTopoFile(path, c.TopoPaths.ClabTmpDir()) + file, err = c.downloadTopoFile(path) if err != nil { return "", err } diff --git a/types/topo_paths.go b/types/topo_paths.go index d1c93ef6f..9d9cb8042 100644 --- a/types/topo_paths.go +++ b/types/topo_paths.go @@ -183,6 +183,12 @@ func (*TopoPaths) ClabTmpDir() string { return clabTmpDir } +// StartupConfigDownloadFileAbsPath returns the absolute path to the startup-config file +// when it is downloaded from a remote location to the clab temp directory. +func (t *TopoPaths) StartupConfigDownloadFileAbsPath(node, postfix string) string { + return filepath.Join(t.ClabTmpDir(), fmt.Sprintf("%s-%s-%s", t.topoName, node, postfix)) +} + // DownloadFileTmpAbsPath returns the absolute path to a file // when it is downloaded from a remote location to the clab temp directory. func (t *TopoPaths) DownloadFileTmpAbsPath(node string, postfix string) string {