mirror of
https://github.com/openvswitch/ovs
synced 2025-08-29 13:27:59 +00:00
ovs-dpctl-top: Fix ovs-dpctl-top via pipe.
Currently it's not possible to use ovs-dpctl-top via pipe (eg: ovs-dpctl dump-flows | ovs-dpctl-top --script --verbose) since Python3 doesn't allow to open a file (stdin in our case) in binary mode without buffering enabled. This commit changes the behaviour in order to directly pass stdin to flows_read instead of re-opening it without buffering. Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
parent
59e8cb8a05
commit
cd475f9765
@ -1236,11 +1236,7 @@ def flows_script(args):
|
|||||||
|
|
||||||
if (args.flowFiles is None):
|
if (args.flowFiles is None):
|
||||||
logging.info("reading flows from stdin")
|
logging.info("reading flows from stdin")
|
||||||
ihdl = os.fdopen(sys.stdin.fileno(), 'r', 0)
|
flow_db = flows_read(sys.stdin, flow_db)
|
||||||
try:
|
|
||||||
flow_db = flows_read(ihdl, flow_db)
|
|
||||||
finally:
|
|
||||||
ihdl.close()
|
|
||||||
else:
|
else:
|
||||||
for flowFile in args.flowFiles:
|
for flowFile in args.flowFiles:
|
||||||
logging.info("reading flows from %s", flowFile)
|
logging.info("reading flows from %s", flowFile)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user