Rev 3510: Fixed as per John's review. in file:///v/home/vila/src/bzr/experimental/more-ftp/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Jun 27 22:57:51 BST 2008


At file:///v/home/vila/src/bzr/experimental/more-ftp/

------------------------------------------------------------
revno: 3510
revision-id: v.ladeuil+lp at free.fr-20080627215743-80k2knfo81vrsc8z
parent: v.ladeuil+lp at free.fr-20080627172606-zn1z2ekknau3qa3c
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: fix-chmod
timestamp: Fri 2008-06-27 23:57:43 +0200
message:
  Fixed as per John's review.
modified:
  bzrlib/tests/ftp_server.py     ftpserver.py-20071019102346-61jbvdkrr70igauv-1
-------------- next part --------------
=== modified file 'bzrlib/tests/ftp_server.py'
--- a/bzrlib/tests/ftp_server.py	2008-06-27 17:26:06 +0000
+++ b/bzrlib/tests/ftp_server.py	2008-06-27 21:57:43 +0000
@@ -41,11 +41,10 @@
     """A custom filesystem wrapper to add missing functionalities."""
 
     def chmod(self, path, mode):
-        p = self.normalize (self.path_module.join (self.wd, path))
+        p = self.normalize(self.path_module.join (self.wd, path))
         return os.chmod(self.translate(p), mode)
 
 
-
 class test_authorizer(object):
     """A custom Authorizer object for running the test suite.
 
@@ -163,12 +162,15 @@
                 self.respond ('550 error creating directory.')
 
     def cmd_site(self, line):
+        """Site specific commands."""
         command, args = line[1].split(' ', 1)
         if command.lower() == 'chmod':
             try:
                 mode, path = args.split()
                 mode = int(mode, 8)
             except ValueError:
+                # We catch both malformed line and malformed mode with the same
+                # ValueError.
                 self.command_not_understood(' '.join(line))
                 return
             try:
@@ -176,9 +178,13 @@
                 self.filesystem.chmod(path, mode)
                 self.respond('200 SITE CHMOD command successful')
             except AttributeError:
-                # The chmod method is not available in read-only
+                # The chmod method is not available in read-only and will raise
+                # AttributeError since a different filesystem is used in that
+                # case
                 self.command_not_authorized(' '.join(line))
         else:
+            # Another site specific command was requested. We don't know that
+            # one
             self.command_not_understood(' '.join(line))
 
 



More information about the bazaar-commits mailing list