]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Correct harmless indentation errors found by pylint
authordavid-sarah <david-sarah@jacaranda.org>
Fri, 26 Feb 2010 06:21:51 +0000 (23:21 -0700)
committerdavid-sarah <david-sarah@jacaranda.org>
Fri, 26 Feb 2010 06:21:51 +0000 (23:21 -0700)
src/allmydata/__init__.py
src/allmydata/test/common.py
src/allmydata/test/test_hung_server.py
src/allmydata/test/test_uri.py

index e098e0ebdfe5b5071a1751d6e0af51a5ae8245c7..dba4513cd21acd5b1e891d6adae94d3abea8ca15 100644 (file)
@@ -119,7 +119,7 @@ def get_linux_distro():
                 if _distname and _version:
                     return (_distname, _version)
     except EnvironmentError:
-            pass
+        pass
 
     (_distname, _version) = platform.dist()[:2]
     if _distname and _version:
index b3784cb3552442a7fe6b56dd6cee4b4432f1a5f3..8f790130f4a9334d321e8bbcf5e9ba26f2f247fa 100644 (file)
@@ -79,16 +79,16 @@ class FakeCHKFileNode:
         data["count-recoverable-versions"] = 1
         data["count-unrecoverable-versions"] = 0
         if is_bad:
-             r.set_healthy(False)
-             r.set_recoverable(True)
-             data["count-shares-good"] = 9
-             data["list-corrupt-shares"] = [(nodeid, self.storage_index, 0)]
-             r.problems = failure.Failure(CorruptShareError(is_bad))
+            r.set_healthy(False)
+            r.set_recoverable(True)
+            data["count-shares-good"] = 9
+            data["list-corrupt-shares"] = [(nodeid, self.storage_index, 0)]
+            r.problems = failure.Failure(CorruptShareError(is_bad))
         else:
-             r.set_healthy(True)
-             r.set_recoverable(True)
-             data["count-shares-good"] = 10
-             r.problems = []
+            r.set_healthy(True)
+            r.set_recoverable(True)
+            data["count-shares-good"] = 10
+            r.problems = []
         r.set_data(data)
         r.set_needs_rebalancing(False)
         return defer.succeed(r)
@@ -250,17 +250,17 @@ class FakeMutableFileNode:
         data["count-recoverable-versions"] = 1
         data["count-unrecoverable-versions"] = 0
         if is_bad:
-             r.set_healthy(False)
-             r.set_recoverable(True)
-             data["count-shares-good"] = 9
-             r.problems = failure.Failure(CorruptShareError("peerid",
-                                                            0, # shnum
-                                                            is_bad))
+            r.set_healthy(False)
+            r.set_recoverable(True)
+            data["count-shares-good"] = 9
+            r.problems = failure.Failure(CorruptShareError("peerid",
+                                                           0, # shnum
+                                                           is_bad))
         else:
-             r.set_healthy(True)
-             r.set_recoverable(True)
-             data["count-shares-good"] = 10
-             r.problems = []
+            r.set_healthy(True)
+            r.set_recoverable(True)
+            data["count-shares-good"] = 10
+            r.problems = []
         r.set_data(data)
         r.set_needs_rebalancing(False)
         return defer.succeed(r)
index 4aef4849b0054fd3ce5f29e3a7eb7ada6070b221..111a299f48c7b70206d164ff616a02ff76dcfe11 100644 (file)
@@ -51,19 +51,19 @@ class HungServerDownloadTest(GridTestMixin, ShouldFailMixin, unittest.TestCase):
                 self._copy_share((i_shnum, i_sharefile), to_server)
 
     def _copy_share(self, share, to_server):
-         (sharenum, sharefile) = share
-         (id, ss) = to_server
-         shares_dir = os.path.join(ss.original.storedir, "shares")
-         si = uri.from_string(self.uri).get_storage_index()
-         si_dir = os.path.join(shares_dir, storage_index_to_dir(si))
-         if not os.path.exists(si_dir):
-             os.makedirs(si_dir)
-         new_sharefile = os.path.join(si_dir, str(sharenum))
-         shutil.copy(sharefile, new_sharefile)
-         self.shares = self.find_shares(self.uri)
-         # Make sure that the storage server has the share.
-         self.failUnless((sharenum, ss.original.my_nodeid, new_sharefile)
-                         in self.shares)
+        (sharenum, sharefile) = share
+        (id, ss) = to_server
+        shares_dir = os.path.join(ss.original.storedir, "shares")
+        si = uri.from_string(self.uri).get_storage_index()
+        si_dir = os.path.join(shares_dir, storage_index_to_dir(si))
+        if not os.path.exists(si_dir):
+            os.makedirs(si_dir)
+        new_sharefile = os.path.join(si_dir, str(sharenum))
+        shutil.copy(sharefile, new_sharefile)
+        self.shares = self.find_shares(self.uri)
+        # Make sure that the storage server has the share.
+        self.failUnless((sharenum, ss.original.my_nodeid, new_sharefile)
+                        in self.shares)
 
     def _corrupt_share(self, share, corruptor_func):
         (sharenum, sharefile) = share
index f6254eb41615206ef50e89a13b6e1b340c7ce3c8..5cbcb08509752d3ac0c356c5610e7a2ad5f2d48e 100644 (file)
@@ -231,14 +231,14 @@ class Unknown(unittest.TestCase):
 
 class Constraint(unittest.TestCase):
     def test_constraint(self):
-       good="http://127.0.0.1:3456/uri/URI%3ADIR2%3Agh3l5rbvnv2333mrfvalmjfr4i%3Alz6l7u3z3b7g37s4zkdmfpx5ly4ib4m6thrpbusi6ys62qtc6mma/"
-       uri.DirectoryURI.init_from_human_encoding(good)
-       self.failUnlessRaises(uri.BadURIError, uri.DirectoryURI.init_from_string, good)
-       bad = good + '==='
-       self.failUnlessRaises(uri.BadURIError, uri.DirectoryURI.init_from_human_encoding, bad)
-       self.failUnlessRaises(uri.BadURIError, uri.DirectoryURI.init_from_string, bad)
-       fileURI = 'URI:CHK:gh3l5rbvnv2333mrfvalmjfr4i:lz6l7u3z3b7g37s4zkdmfpx5ly4ib4m6thrpbusi6ys62qtc6mma:3:10:345834'
-       uri.CHKFileURI.init_from_string(fileURI)
+        good="http://127.0.0.1:3456/uri/URI%3ADIR2%3Agh3l5rbvnv2333mrfvalmjfr4i%3Alz6l7u3z3b7g37s4zkdmfpx5ly4ib4m6thrpbusi6ys62qtc6mma/"
+        uri.DirectoryURI.init_from_human_encoding(good)
+        self.failUnlessRaises(uri.BadURIError, uri.DirectoryURI.init_from_string, good)
+        bad = good + '==='
+        self.failUnlessRaises(uri.BadURIError, uri.DirectoryURI.init_from_human_encoding, bad)
+        self.failUnlessRaises(uri.BadURIError, uri.DirectoryURI.init_from_string, bad)
+        fileURI = 'URI:CHK:gh3l5rbvnv2333mrfvalmjfr4i:lz6l7u3z3b7g37s4zkdmfpx5ly4ib4m6thrpbusi6ys62qtc6mma:3:10:345834'
+        uri.CHKFileURI.init_from_string(fileURI)
 
 class Mutable(unittest.TestCase):
     def test_pack(self):