Skip to content

Commit

Permalink
fixed destroy --all when outside of topo dir
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Feb 19, 2021
1 parent f8789bb commit 35dd88a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io"
"os"
"path/filepath"
"strings"
"sync"

Expand Down Expand Up @@ -80,6 +81,12 @@ var destroyCmd = &cobra.Command{
clab.WithGracefulShutdown(graceful),
}
c = clab.NewContainerLab(opts...)
// change to the dir where topo file is located
// to resolve relative paths of license/configs in ParseTopology
if err = os.Chdir(filepath.Dir(topo)); err != nil {
return err
}

// Parse topology information
if err = c.ParseTopology(); err != nil {
return err
Expand Down

0 comments on commit 35dd88a

Please sign in to comment.