From 4e68faebb40543dc50a42cc052880f63932c92da Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 5 Nov 2008 13:45:11 -0700 Subject: [PATCH] sftpd: minor debug-logging tweak --- src/allmydata/sftpd.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/allmydata/sftpd.py b/src/allmydata/sftpd.py index 1b0a91f5..790e5d7e 100644 --- a/src/allmydata/sftpd.py +++ b/src/allmydata/sftpd.py @@ -132,13 +132,15 @@ class SFTPHandler: return {} def openFile(self, filename, flags, attrs): - f = "|".join([(flags & FXF_READ) and "FXF_READ" or "", - (flags & FXF_WRITE) and "FXF_WRITE" or "", - (flags & FXF_APPEND) and "FXF_APPEND" or "", - (flags & FXF_CREAT) and "FXF_CREAT" or "", - (flags & FXF_TRUNC) and "FXF_TRUNC" or "", - (flags & FXF_EXCL) and "FXF_EXCL" or "", - ]) + f = "|".join([f for f in + [(flags & FXF_READ) and "FXF_READ" or None, + (flags & FXF_WRITE) and "FXF_WRITE" or None, + (flags & FXF_APPEND) and "FXF_APPEND" or None, + (flags & FXF_CREAT) and "FXF_CREAT" or None, + (flags & FXF_TRUNC) and "FXF_TRUNC" or None, + (flags & FXF_EXCL) and "FXF_EXCL" or None, + ] + if f]) print "OPENFILE", filename, flags, f, attrs # this is used for both reading and writing. -- 2.45.2