Message ID | 1479115454-48163-5-git-send-email-nic@opencloud.tech |
---|---|
State | Accepted |
Headers | show |
Nick, nickcooper-zhangtonghao <nic@opencloud.tech> writes: > Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech> > --- > utilities/ovs-tcpdump.in | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/utilities/ovs-tcpdump.in b/utilities/ovs-tcpdump.in > index 96aa1e2..d984a39 100755 > --- a/utilities/ovs-tcpdump.in > +++ b/utilities/ovs-tcpdump.in > @@ -433,7 +433,9 @@ def main(): > print(data) > raise KeyboardInterrupt > except KeyboardInterrupt: > - pipes.terminate() > + if pipes.poll() is None: > + pipes.terminate() > + Thanks for the work on this - do you think it would be okay to also add something like: sys.exit(pipes.returncode) Or even: if pipes.returncode < 0: os.kill(os.getpid(), signal.SIGABRT) else: sys.exit(pipes.returncode) ? Either way, the change you have above should be applied, so: Acked-by: Aaron Conole <aconole@redhat.com>
diff --git a/utilities/ovs-tcpdump.in b/utilities/ovs-tcpdump.in index 96aa1e2..d984a39 100755 --- a/utilities/ovs-tcpdump.in +++ b/utilities/ovs-tcpdump.in @@ -433,7 +433,9 @@ def main(): print(data) raise KeyboardInterrupt except KeyboardInterrupt: - pipes.terminate() + if pipes.poll() is None: + pipes.terminate() + ovsdb.destroy_mirror(interface, ovsdb.port_bridge(interface)) ovsdb.destroy_port(mirror_interface, ovsdb.port_bridge(interface)) except Exception:
Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech> --- utilities/ovs-tcpdump.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)