Skip to content

Commit

Permalink
v0.2.4; fix bug of debug output for visual; minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cpflat committed Jun 12, 2023
1 parent 3fc2648 commit 8118d65
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
12 changes: 6 additions & 6 deletions example/ospf_topo1/ospf.dot
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ digraph {
r1[class="router"];
r2[class="router"];
r3[class="router"];
s1[class="switch"]
s2[class="switch"]
s3[class="switch"]
s4[class="switch"]
s1[class="switch"];
s2[class="switch"];
s3[class="switch"];
s4[class="switch"];
}

subgraph cluster2 {
label="area=1; area6=0.0.0.1";
r4[class="router"];
s5[class="switch"]
s6[class="switch"]
s5[class="switch"];
s6[class="switch"];
}

r1->s1[dir="none"];
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const (
)

var (
Version = "0.2.3"
Version = "0.2.4"
)

func main() {
Expand Down
3 changes: 3 additions & 0 deletions pkg/clab/clab.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ func GetClabTopology(cfg *model.Config, nm *model.NetworkModel) ([]byte, error)
// add mount points
for _, filename := range node.Files.FileNames() {
file := node.Files.GetFile(filename)
if file.FileDefinition.Path == "" {
continue
}
dirpath, err := filepath.Abs(node.Name)
if err != nil {
return nil, fmt.Errorf("directory path panic")
Expand Down
1 change: 1 addition & 0 deletions pkg/model/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ type GlobalSettings struct {
type FileDefinition struct {
Name string `yaml:"name" mapstructure:"name"`
// Path is the path that the generated file is placed on the node.
// If empty, the file is generated but not placed on the node.
Path string `yaml:"path" mapstructure:"path"`
// Format is used to determine format and the way to aggregate the config blocks
// The value can be "shell", "frr", etc. "file" in default.
Expand Down
3 changes: 1 addition & 2 deletions pkg/model/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (a addressedObject) IsAware(layer string) bool {
return a.awareLayers.Contains(layer)
}

// NameSpacer includes Node, Interface, Neighbor, Group
// NameSpacer includes Node, Interface, Neighbor, Member, Group
type NameSpacer interface {
setNumbered(k string)
isNumbered(k string) bool
Expand Down Expand Up @@ -222,7 +222,6 @@ func (ns *NameSpace) GetValue(key string) (string, error) {
if ok {
return val, nil
} else {
fmt.Printf("%+v, %+v\n", key, ns)
return val, fmt.Errorf("unknown key %v", key)
}
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/tinet/tinet.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ func GetTinetSpecification(cfg *model.Config, nm *model.NetworkModel) ([]byte, e
// add mount points for file outputs
for _, filename := range n.Files.FileNames() {
file := n.Files.GetFile(filename)
if file.FileDefinition.Path == "" {
continue
}
dirpath, err := filepath.Abs(n.Name) // requires absolute path
if err != nil {
return nil, fmt.Errorf("directory path panic")
Expand Down

0 comments on commit 8118d65

Please sign in to comment.