From: Ben Pfaff Date: Tue, 21 Jun 2011 22:12:49 +0000 (-0700) Subject: ovs-ctl: Use "action" to print success or failure directly. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=751d0ddbedf919854da3d2c6e5ed76b755c15920;p=openvswitch ovs-ctl: Use "action" to print success or failure directly. This displays errors in whatever fashion the distro prefers, which seems like a good idea. We have to use a shell function so that the redirection to a temporary file doesn't write the messages for the admin to the file instead of the console. --- diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in index 923e1b53..a127149a 100755 --- a/utilities/ovs-ctl.in +++ b/utilities/ovs-ctl.in @@ -222,6 +222,10 @@ internal_interfaces () { done } +save_interfaces () { + "$datadir/scripts/ovs-save" $ifaces > "$script" +} + force_reload_kmod () { ifaces=`internal_interfaces` action "Detected internal interfaces: $ifaces" true @@ -229,8 +233,7 @@ force_reload_kmod () { stop script=`mktemp` - action "Save interface configuration to $script" true - if "$datadir/scripts/ovs-save" $ifaces > "$script"; then + if action "Save interface configuration to $script" save_interfaces; then : else log_warning_msg "Failed to save configuration, not replacing kernel module"