From: Brian Warner Date: Wed, 5 Nov 2008 20:45:11 +0000 (-0700) Subject: sftpd: minor debug-logging tweak X-Git-Url: https://git.rkrishnan.org/provisioning?a=commitdiff_plain;h=4e68faebb40543dc50a42cc052880f63932c92da;p=tahoe-lafs%2Ftahoe-lafs.git sftpd: minor debug-logging tweak --- 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.