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: if options.outfile:
err = self.start_stream_to_path( err = self.start_stream_to_path(
options.outfile[0], options.outfile[0],
options.outfile[1] options.outfile[1],
self.filt
) )
if err: if err:
raise DumpError(err) raise DumpError(err)

View File

@ -1098,11 +1098,11 @@ class FlowMaster(controller.ServerMaster):
self.stream.fo.close() self.stream.fo.close()
self.stream = None 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) path = os.path.expanduser(path)
try: try:
f = file(path, mode) f = open(path, mode)
self.start_stream(f, None) self.start_stream(f, filt)
except IOError as v: except IOError as v:
return str(v) return str(v)
self.stream_path = path self.stream_path = path