Skip to content

Commit

Permalink
Log ovs dump-flows at 5, not 4
Browse files Browse the repository at this point in the history
Most dump-flows calls are part of health checks and don't normally
need to be logged about unless they fail.
  • Loading branch information
danwinship committed May 2, 2018
1 parent 928f1cd commit 473dcfd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/util/ovs/ovs.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,17 @@ func New(execer exec.Interface, bridge string, minVersion string) (Interface, er
}

func (ovsif *ovsExec) exec(cmd string, args ...string) (string, error) {
logLevel := glog.Level(4)
switch cmd {
case OVS_OFCTL:
if args[0] == "dump-flows" {
logLevel = glog.Level(5)
}
args = append([]string{"-O", "OpenFlow13"}, args...)
case OVS_VSCTL:
args = append([]string{"--timeout=30"}, args...)
}
glog.V(4).Infof("Executing: %s %s", cmd, strings.Join(args, " "))
glog.V(logLevel).Infof("Executing: %s %s", cmd, strings.Join(args, " "))

output, err := ovsif.execer.Command(cmd, args...).CombinedOutput()
if err != nil {
Expand Down

0 comments on commit 473dcfd

Please sign in to comment.