Skip to content

Commit 93bf471

Browse files
committed
update
1 parent 1f5f552 commit 93bf471

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

clab/clab.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func (c *CLab) ProcessTopoPath(path string) (string, error) {
154154
}
155155
// if the path is not a local file and a URL, download the file and store it in the tmp dir
156156
case !utils.FileOrDirExists(path) && utils.IsHttpURL(path, true):
157-
file, err = downloadTopoFile(path, c.TopoPaths.ClabTmpDir())
157+
file, err = c.downloadTopoFile(path)
158158
if err != nil {
159159
return "", err
160160
}

types/topo_paths.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ func (*TopoPaths) ClabTmpDir() string {
183183
return clabTmpDir
184184
}
185185

186+
// StartupConfigDownloadFileAbsPath returns the absolute path to the startup-config file
187+
// when it is downloaded from a remote location to the clab temp directory.
188+
func (t *TopoPaths) StartupConfigDownloadFileAbsPath(node, postfix string) string {
189+
return filepath.Join(t.ClabTmpDir(), fmt.Sprintf("%s-%s-%s", t.topoName, node, postfix))
190+
}
191+
186192
// DownloadFileTmpAbsPath returns the absolute path to a file
187193
// when it is downloaded from a remote location to the clab temp directory.
188194
func (t *TopoPaths) DownloadFileTmpAbsPath(node string, postfix string) string {

0 commit comments

Comments
 (0)