Skip to content

Commit b96e948

Browse files
authored
Merge pull request #76 from ecbaldwin/save-command
Save ovs-appctl command for reference by callers
2 parents 1141932 + d361661 commit b96e948

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ovs/app.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package ovs
1616

1717
import (
18+
"fmt"
1819
"strings"
1920
)
2021

@@ -42,12 +43,15 @@ func (a *AppService) ProtoTrace(bridge string, protocol Protocol, matches []Matc
4243
}
4344

4445
matchArg := strings.Join(matchFlows, ",")
45-
out, err := a.exec("ofproto/trace", bridge, matchArg)
46+
args := []string{"ofproto/trace", bridge, matchArg}
47+
out, err := a.exec(args...)
4648
if err != nil {
4749
return nil, err
4850
}
4951

50-
pt := &ProtoTrace{}
52+
pt := &ProtoTrace{
53+
CommandStr: fmt.Sprintf("ovs-appctl %s", strings.Join(args, " ")),
54+
}
5155
err = pt.UnmarshalText(out)
5256
if err != nil {
5357
return nil, err

ovs/proto_trace.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ func (df *DataPathFlows) UnmarshalText(b []byte) error {
109109

110110
// ProtoTrace is a type representing output from ovs-app-ctl ofproto/trace
111111
type ProtoTrace struct {
112+
CommandStr string
112113
InputFlow *DataPathFlows
113114
FinalFlow *DataPathFlows
114115
DataPathActions DataPathActions

0 commit comments

Comments
 (0)