This commit is contained in:
Maximilian Hils 2016-04-28 17:51:53 -07:00
parent 613a05b5b7
commit c7a85d1b9e
2 changed files with 5 additions and 4 deletions

View File

@ -91,7 +91,8 @@ class DumpMaster(flow.FlowMaster):
if options.outfile:
err = self.start_stream_to_path(
options.outfile[0],
options.outfile[1]
options.outfile[1],
self.filt
)
if err:
raise DumpError(err)

View File

@ -1098,11 +1098,11 @@ class FlowMaster(controller.ServerMaster):
self.stream.fo.close()
self.stream = None
def start_stream_to_path(self, path, mode="wb"):
def start_stream_to_path(self, path, mode="wb", filt=None):
path = os.path.expanduser(path)
try:
f = file(path, mode)
self.start_stream(f, None)
f = open(path, mode)
self.start_stream(f, filt)
except IOError as v:
return str(v)
self.stream_path = path