]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Merge pull request #204 from leif/preferred_peers-rebased3
authorDaira Hopwood <daira@jacaranda.org>
Fri, 4 Dec 2015 18:01:30 +0000 (18:01 +0000)
committerDaira Hopwood <daira@jacaranda.org>
Fri, 4 Dec 2015 18:01:30 +0000 (18:01 +0000)
new feature: preferred storage servers

.travis.yml
docs/quickstart.rst
setup.py
src/allmydata/scripts/create_node.py
src/allmydata/test/test_runner.py

index 1c0a256edc09cdb549c5083ae8e2d00cbd234e72..5df0e85d78815660f829ea00132041f5afca6997 100644 (file)
@@ -2,7 +2,6 @@ sudo: false
 language: python
 python:
   - "2.7"
-  - "2.6"
   - "pypy"
 before_install:
   - sh -c set
index d7161123b079d98c6b9a6cd18d6ad09cbd5ff1a5..ebef68b499a82a4b412b5cbdbb412d28f9cf95dc 100644 (file)
@@ -31,13 +31,13 @@ Install Python
 --------------
 
 Check if you already have an adequate version of Python installed by running
-``python -V``. Python v2.6 (v2.6.6 or greater recommended) or Python v2.7
-will work. Python v3 does not work. On Windows, we recommend the use of
-native Python v2.7, not Cygwin Python. If you don't have one of these
-versions of Python installed, `download`_ and install the latest version of
-Python v2.7. Make sure that the path to the installation directory has no
-spaces in it (e.g. on Windows, do not install Python in the "Program Files"
-directory).
+``python -V``. The latest version of Python v2.7 is recommended. Python v2.6.x
+is no longer officially supported, but might still work. Python v3 does not
+work. On Windows, we recommend the use of native Python v2.7, not Cygwin
+Python. If you don't have one of these versions of Python installed,
+`download`_ and install the latest version of Python v2.7. Make sure that the
+path to the installation directory has no spaces in it (e.g. on Windows, do not
+install Python in the "Program Files" directory).
 
 .. _download: https://www.python.org/downloads/
 
index 035b0c9c31d34ccbc4e1e44c5b777620dba362c6..63697e004a4c7113b18d6733d8a7973719e97c72 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
-import sys; assert sys.version_info < (3,), ur"Tahoe-LAFS does not run under Python 3. Please use a version of Python between 2.6 and 2.7.x inclusive."
+import sys; assert sys.version_info < (3,), ur"Tahoe-LAFS does not run under Python 3. Please use Python 2.7.x."
 
 # Tahoe-LAFS -- secure, distributed storage grid
 #
@@ -101,7 +101,6 @@ trove_classifiers=[
     "Programming Language :: C",
     "Programming Language :: Python",
     "Programming Language :: Python :: 2",
-    "Programming Language :: Python :: 2.6",
     "Programming Language :: Python :: 2.7",
     "Topic :: Utilities",
     "Topic :: System :: Systems Administration",
@@ -249,7 +248,7 @@ def run_command(args, cwd=None):
     use_shell = sys.platform == "win32"
     try:
         p = subprocess.Popen(args, stdout=subprocess.PIPE, cwd=cwd, shell=use_shell)
-    except EnvironmentError as e:  # if this gives a SyntaxError, note that Tahoe-LAFS requires Python 2.6+
+    except EnvironmentError as e:  # if this gives a SyntaxError, note that Tahoe-LAFS requires Python 2.7+
         print("Warning: unable to run %r." % (" ".join(args),))
         print(e)
         return None
index 65cbb63ae740d1e8630dffde99ee820e59a08914..517085e5966aa0f1d9cf56e44cad20b8f55e4f34 100644 (file)
@@ -3,7 +3,7 @@ import os, sys
 from allmydata.scripts.common import BasedirOptions, NoDefaultBasedirOptions
 from allmydata.scripts.default_nodedir import _default_nodedir
 from allmydata.util.assertutil import precondition
-from allmydata.util.encodingutil import listdir_unicode, argv_to_unicode, quote_output, quote_local_unicode_path
+from allmydata.util.encodingutil import listdir_unicode, argv_to_unicode, quote_local_unicode_path
 import allmydata
 
 class _CreateBaseOptions(BasedirOptions):
@@ -109,7 +109,7 @@ def create_node(config, out=sys.stdout, err=sys.stderr):
 
     if os.path.exists(basedir):
         if listdir_unicode(basedir):
-            print >>err, "The base directory %s is not empty." % quote_output(basedir)
+            print >>err, "The base directory %s is not empty." % quote_local_unicode_path(basedir)
             print >>err, "To avoid clobbering anything, I am going to quit now."
             print >>err, "Please use a different directory, or empty this one."
             return -1
@@ -165,7 +165,7 @@ def create_node(config, out=sys.stdout, err=sys.stderr):
 
     from allmydata.util import fileutil
     fileutil.make_dirs(os.path.join(basedir, "private"), 0700)
-    print >>out, "Node created in %s" % quote_output(basedir)
+    print >>out, "Node created in %s" % quote_local_unicode_path(basedir)
     if not config.get("introducer", ""):
         print >>out, " Please set [client]introducer.furl= in tahoe.cfg!"
         print >>out, " The node cannot connect to a grid without it."
@@ -185,7 +185,7 @@ def create_introducer(config, out=sys.stdout, err=sys.stderr):
 
     if os.path.exists(basedir):
         if listdir_unicode(basedir):
-            print >>err, "The base directory %s is not empty." % quote_output(basedir)
+            print >>err, "The base directory %s is not empty." % quote_local_unicode_path(basedir)
             print >>err, "To avoid clobbering anything, I am going to quit now."
             print >>err, "Please use a different directory, or empty this one."
             return -1
@@ -200,7 +200,7 @@ def create_introducer(config, out=sys.stdout, err=sys.stderr):
     write_node_config(c, config)
     c.close()
 
-    print >>out, "Introducer created in %s" % quote_output(basedir)
+    print >>out, "Introducer created in %s" % quote_local_unicode_path(basedir)
     return 0
 
 
index 3c79777f8f7df8aa1b26e6d4989f443099d23613..66ca466c53cadac929f07bf699b0f835c84e7dca 100644 (file)
@@ -298,6 +298,19 @@ class CreateNode(unittest.TestCase):
         self.failUnless(os.path.exists(n3))
         self.failUnless(os.path.exists(os.path.join(n3, tac)))
 
+        if kind in ("client", "node", "introducer"):
+            # test that the output (without --quiet) includes the base directory
+            n4 = os.path.join(basedir, command + "-n4")
+            argv = [command, n4]
+            rc, out, err = self.run_tahoe(argv)
+            self.failUnlessEqual(err, "")
+            self.failUnlessIn(" created in ", out)
+            self.failUnlessIn(n4, out)
+            self.failIfIn("\\\\?\\", out)
+            self.failUnlessEqual(rc, 0)
+            self.failUnless(os.path.exists(n4))
+            self.failUnless(os.path.exists(os.path.join(n4, tac)))
+
         # make sure it rejects too many arguments
         argv = [command, "basedir", "extraarg"]
         self.failUnlessRaises(usage.UsageError,