3 patches for repository /home/zooko/playground/tahoe-lafs/ticket1409-remove_contrib_fuse: Thu Mar 31 08:54:27 MDT 2011 zooko@zooko.com * tests: use fileutil.write() instead of open() to ensure timely close even without CPython-style reference counting Some of these already had an explicit close() but I went ahead and replaced them with fileutil.write() as well for the sake of uniformity. Sun Jul 24 17:17:52 MDT 2011 zooko@zooko.com * reject old-style (pre-Tahoe-LAFS-v1.3) configuration files Check for the existence of any of them and if any are found raise exception which will abort the startup of the node. This is a backwards-incompatible change for anyone who is still using old-style configuration files. fixes #1385 Sun Jul 24 19:55:46 MDT 2011 zooko@zooko.com * whitespace-cleanup New patches: [tests: use fileutil.write() instead of open() to ensure timely close even without CPython-style reference counting zooko@zooko.com**20110331145427 Ignore-this: 75aae4ab8e5fa0ad698f998aaa1888ce Some of these already had an explicit close() but I went ahead and replaced them with fileutil.write() as well for the sake of uniformity. ] { hunk ./src/allmydata/test/test_client.py 24 def test_loadable(self): basedir = "test_client.Basic.test_loadable" os.mkdir(basedir) - open(os.path.join(basedir, "introducer.furl"), "w").write("") + fileutil.write(os.path.join(basedir, "introducer.furl"), "") client.Client(basedir) def test_loadable_old_config_bits(self): hunk ./src/allmydata/test/test_client.py 30 basedir = "test_client.Basic.test_loadable_old_config_bits" os.mkdir(basedir) - open(os.path.join(basedir, "introducer.furl"), "w").write("") - open(os.path.join(basedir, "no_storage"), "w").write("") - open(os.path.join(basedir, "readonly_storage"), "w").write("") - open(os.path.join(basedir, "debug_discard_storage"), "w").write("") + fileutil.write(os.path.join(basedir, "introducer.furl"), "") + fileutil.write(os.path.join(basedir, "no_storage"), "") + fileutil.write(os.path.join(basedir, "readonly_storage"), "") + fileutil.write(os.path.join(basedir, "debug_discard_storage"), "") c = client.Client(basedir) try: c.getServiceNamed("storage") hunk ./src/allmydata/test/test_client.py 44 def test_loadable_old_storage_config_bits(self): basedir = "test_client.Basic.test_loadable_old_storage_config_bits" os.mkdir(basedir) - open(os.path.join(basedir, "introducer.furl"), "w").write("") - open(os.path.join(basedir, "readonly_storage"), "w").write("") - open(os.path.join(basedir, "debug_discard_storage"), "w").write("") + fileutil.write(os.path.join(basedir, "introducer.furl"), "") + fileutil.write(os.path.join(basedir, "readonly_storage"), "") + fileutil.write(os.path.join(basedir, "debug_discard_storage"), "") c = client.Client(basedir) s = c.getServiceNamed("storage") self.failUnless(s.no_storage) hunk ./src/allmydata/test/test_client.py 55 def test_secrets(self): basedir = "test_client.Basic.test_secrets" os.mkdir(basedir) - open(os.path.join(basedir, "introducer.furl"), "w").write("") + fileutil.write(os.path.join(basedir, "introducer.furl"), "") c = client.Client(basedir) secret_fname = os.path.join(basedir, "private", "secret") self.failUnless(os.path.exists(secret_fname), secret_fname) hunk ./src/allmydata/test/test_client.py 67 def test_reserved_1(self): basedir = "client.Basic.test_reserved_1" os.mkdir(basedir) - f = open(os.path.join(basedir, "tahoe.cfg"), "w") - f.write(BASECONFIG) - f.write("[storage]\n") - f.write("enabled = true\n") - f.write("reserved_space = 1000\n") - f.close() + fileutil.write(os.path.join(basedir, "tahoe.cfg"), \ + BASECONFIG + \ + "[storage]\n" + \ + "enabled = true\n" + \ + "reserved_space = 1000\n") c = client.Client(basedir) self.failUnlessEqual(c.getServiceNamed("storage").reserved_space, 1000) hunk ./src/allmydata/test/test_client.py 78 def test_reserved_2(self): basedir = "client.Basic.test_reserved_2" os.mkdir(basedir) - f = open(os.path.join(basedir, "tahoe.cfg"), "w") - f.write(BASECONFIG) - f.write("[storage]\n") - f.write("enabled = true\n") - f.write("reserved_space = 10K\n") - f.close() + fileutil.write(os.path.join(basedir, "tahoe.cfg"), \ + BASECONFIG + \ + "[storage]\n" + \ + "enabled = true\n" + \ + "reserved_space = 10K\n") c = client.Client(basedir) self.failUnlessEqual(c.getServiceNamed("storage").reserved_space, 10*1000) hunk ./src/allmydata/test/test_client.py 89 def test_reserved_3(self): basedir = "client.Basic.test_reserved_3" os.mkdir(basedir) - f = open(os.path.join(basedir, "tahoe.cfg"), "w") - f.write(BASECONFIG) - f.write("[storage]\n") - f.write("enabled = true\n") - f.write("reserved_space = 5mB\n") - f.close() + fileutil.write(os.path.join(basedir, "tahoe.cfg"), \ + BASECONFIG + \ + "[storage]\n" + \ + "enabled = true\n" + \ + "reserved_space = 5mB\n") c = client.Client(basedir) self.failUnlessEqual(c.getServiceNamed("storage").reserved_space, 5*1000*1000) hunk ./src/allmydata/test/test_client.py 101 def test_reserved_4(self): basedir = "client.Basic.test_reserved_4" os.mkdir(basedir) - f = open(os.path.join(basedir, "tahoe.cfg"), "w") - f.write(BASECONFIG) - f.write("[storage]\n") - f.write("enabled = true\n") - f.write("reserved_space = 78Gb\n") - f.close() + fileutil.write(os.path.join(basedir, "tahoe.cfg"), \ + BASECONFIG + \ + "[storage]\n" + \ + "enabled = true\n" + \ + "reserved_space = 78Gb\n") c = client.Client(basedir) self.failUnlessEqual(c.getServiceNamed("storage").reserved_space, 78*1000*1000*1000) hunk ./src/allmydata/test/test_client.py 113 def test_reserved_bad(self): basedir = "client.Basic.test_reserved_bad" os.mkdir(basedir) - f = open(os.path.join(basedir, "tahoe.cfg"), "w") - f.write(BASECONFIG) - f.write("[storage]\n") - f.write("enabled = true\n") - f.write("reserved_space = bogus\n") - f.close() + fileutil.write(os.path.join(basedir, "tahoe.cfg"), \ + BASECONFIG + \ + "[storage]\n" + \ + "enabled = true\n" + \ + "reserved_space = bogus\n") c = client.Client(basedir) self.failUnlessEqual(c.getServiceNamed("storage").reserved_space, 0) hunk ./src/allmydata/test/test_client.py 137 def test_versions(self): basedir = "test_client.Basic.test_versions" os.mkdir(basedir) - open(os.path.join(basedir, "introducer.furl"), "w").write("") + fileutil.write(os.path.join(basedir, "introducer.furl"), "") c = client.Client(basedir) ss = c.getServiceNamed("storage") verdict = ss.remote_get_version() hunk ./src/allmydata/test/test_client.py 175 basedir = "test_client.Run.test_loadable" os.mkdir(basedir) dummy = "pb://wl74cyahejagspqgy4x5ukrvfnevlknt@127.0.0.1:58889/bogus" - open(os.path.join(basedir, "introducer.furl"), "w").write(dummy) - open(os.path.join(basedir, "suicide_prevention_hotline"), "w") + fileutil.write(os.path.join(basedir, "introducer.furl"), dummy) + fileutil.write(os.path.join(basedir, "suicide_prevention_hotline"), "") client.Client(basedir) def test_reloadable(self): hunk ./src/allmydata/test/test_client.py 183 basedir = "test_client.Run.test_reloadable" os.mkdir(basedir) dummy = "pb://wl74cyahejagspqgy4x5ukrvfnevlknt@127.0.0.1:58889/bogus" - open(os.path.join(basedir, "introducer.furl"), "w").write(dummy) + fileutil.write(os.path.join(basedir, "introducer.furl"), dummy) c1 = client.Client(basedir) c1.setServiceParent(self.sparent) hunk ./src/allmydata/test/test_client.py 216 def test_maker(self): basedir = "client/NodeMaker/maker" fileutil.make_dirs(basedir) - f = open(os.path.join(basedir, "tahoe.cfg"), "w") - f.write(BASECONFIG) - f.close() + fileutil.write(os.path.join(basedir, "tahoe.cfg"), BASECONFIG) c = client.Client(basedir) n = c.create_node_from_uri("URI:CHK:6nmrpsubgbe57udnexlkiwzmlu:bjt7j6hshrlmadjyr7otq3dc24end5meo5xcr5xe5r663po6itmq:3:10:7277") } [reject old-style (pre-Tahoe-LAFS-v1.3) configuration files zooko@zooko.com**20110724231752 Ignore-this: 7f9df8e086d60332080f6c2eca0ac3d6 Check for the existence of any of them and if any are found raise exception which will abort the startup of the node. This is a backwards-incompatible change for anyone who is still using old-style configuration files. fixes #1385 ] { hunk ./docs/configuration.rst 181 Most users will not need to set ``tub.location``. - Note that the old ``advertised_ip_addresses`` file from earlier releases is - no longer supported. Tahoe-LAFS v1.3.0 and later will ignore this file. - ``log_gatherer.furl = (FURL, optional)`` If provided, this contains a single FURL string that is used to contact hunk ./docs/configuration.rst 185 a "log gatherer", which will be granted access to the logport. This can - be used by centralized storage grids to gather operational logs in a - single place. Note that when an old-style ``BASEDIR/log_gatherer.furl`` file - exists (see `Backwards Compatibility Files`_, below), both are used. (For - most other items, the separate config file overrides the entry in - ``tahoe.cfg``.) + be used to gather operational logs in a single place. Note that in + previous releases of Tahoe-LAFS, if an old-style + ``BASEDIR/log_gatherer.furl`` file existed it would also be used in + addition to this value, allowing multiple log gatherers to be used at + once. As of Tahoe-LAFS v1.9.0, an old-style file file is ignored and a + warning will be emitted if one is detected. This means that as of + Tahoe-LAFS v1.9.0 you can have at most one log gatherer per node. See + ticket #1423 about lifting this restriction and letting you have + multiple log gatherers. ``timeout.keepalive = (integer in seconds, optional)`` hunk ./docs/configuration.rst 305 ratios are more reliable, and small ``N``/``k`` ratios use less disk space. Clearly, ``k`` must never be greater than ``N``. - Large values of ``N`` will slow down upload operations slightly, since more - servers must be involved, and will slightly increase storage overhead due - to the hash trees that are created. Large values of ``k`` will cause - downloads to be marginally slower, because more servers must be involved. - ``N`` cannot be larger than 256, because of the 8-bit erasure-coding - algorithm that Tahoe-LAFS uses. + These values control the tradeoff between storage overhead, performance, + and reliability. To a first approximation, a 1MB file will use (1MB * ``N``/``k``) + of backend storage space (the actual value will be a bit more, because of + other forms of overhead). Up to ``N``-``k`` shares can be lost before the file + becomes unrecoverable, so assuming there are at least ``N`` servers, up to + ``N``-``k`` servers can be offline without losing the file. So large ``N``/``k`` + ratios are more reliable, and small ``N``/``k`` ratios use less disk space. + Clearly, ``k`` must never be greater than ``N``. ``shares.happy`` allows you control over the distribution of your immutable file. For a successful upload, shares are guaranteed to be initially hunk ./docs/configuration.rst 567 "which peers am I connected to" list), and the shortened form (the first few characters) is recorded in various log messages. -Backwards Compatibility Files -============================= - -Tahoe-LAFS releases before v1.3.0 had no ``tahoe.cfg`` file, and used distinct -files for each item listed below. For each configuration knob, if the distinct -file exists, it will take precedence over the corresponding item in ``tahoe.cfg``. - -=============================== =================================== ================= -Config setting File Comment -=============================== =================================== ================= -``[node]nickname`` ``BASEDIR/nickname`` -``[node]web.port`` ``BASEDIR/webport`` -``[node]tub.port`` ``BASEDIR/client.port`` (for Clients, not Introducers) -``[node]tub.port`` ``BASEDIR/introducer.port`` (for Introducers, not Clients) (note that, unlike other keys, ``tahoe.cfg`` overrides this file) -``[node]tub.location`` ``BASEDIR/advertised_ip_addresses`` -``[node]log_gatherer.furl`` ``BASEDIR/log_gatherer.furl`` (one per line) -``[node]timeout.keepalive`` ``BASEDIR/keepalive_timeout`` -``[node]timeout.disconnect`` ``BASEDIR/disconnect_timeout`` -``[client]introducer.furl`` ``BASEDIR/introducer.furl`` -``[client]helper.furl`` ``BASEDIR/helper.furl`` -``[client]key_generator.furl`` ``BASEDIR/key_generator.furl`` -``[client]stats_gatherer.furl`` ``BASEDIR/stats_gatherer.furl`` -``[storage]enabled`` ``BASEDIR/no_storage`` (``False`` if ``no_storage`` exists) -``[storage]readonly`` ``BASEDIR/readonly_storage`` (``True`` if ``readonly_storage`` exists) -``[storage]sizelimit`` ``BASEDIR/sizelimit`` -``[storage]debug_discard`` ``BASEDIR/debug_discard_storage`` -``[helper]enabled`` ``BASEDIR/run_helper`` (``True`` if ``run_helper`` exists) -=============================== =================================== ================= - -Note: the functionality of ``[node]ssh.port`` and ``[node]ssh.authorized_keys_file`` -were previously combined, controlled by the presence of a -``BASEDIR/authorized_keys.SSHPORT`` file, in which the suffix of the filename -indicated which port the ssh server should listen on, and the contents of the -file provided the ssh public keys to accept. Support for these files has been -removed completely. To ``ssh`` into your Tahoe-LAFS node, add ``[node]ssh.port`` -and ``[node].ssh_authorized_keys_file`` statements to your ``tahoe.cfg``. - -Likewise, the functionality of ``[node]tub.location`` is a variant of the -now-unsupported ``BASEDIR/advertised_ip_addresses`` . The old file was additive -(the addresses specified in ``advertised_ip_addresses`` were used in addition to -any that were automatically discovered), whereas the new ``tahoe.cfg`` directive -is not (``tub.location`` is used verbatim). - Example ======= hunk ./docs/configuration.rst 602 [helper] enabled = True + + +Old Configuration Files +======================= + +Tahoe-LAFS releases before v1.3.0 had no ``tahoe.cfg`` file, and used +distinct files for each item. This is no longer supported and if you +have configuration in the old format you must manually convert it to +the new format for Tahoe-LAFS to detect it. See +``_. hunk ./docs/frontends/CLI.rst 92 creates a new directory and populates it with files that will allow the "``tahoe start``" command to use it later on. This command creates nodes that have client functionality (upload/download files), web API services -(controlled by the 'webport' file), and storage services (unless -``--no-storage`` is specified). +(controlled by the '[node]web.port' configuration), and storage services +(unless ``--no-storage`` is specified). NODEDIR defaults to ``~/.tahoe/`` , and newly-created nodes default to publishing a web server on port 3456 (limited to the loopback interface, at addfile ./docs/historical/configuration.rst hunk ./docs/historical/configuration.rst 1 +======================= +Old Configuration Files +======================= + +Tahoe-LAFS releases before v1.3.0 had no ``tahoe.cfg`` file, and used +distinct files for each item listed below. If Tahoe-LAFS v1.9.0 or above +detects the old configuration files at start up it emits a warning and +aborts the start up. (This was issue ticket #1385.) + +=============================== =================================== ================= +Config setting File Comment +=============================== =================================== ================= +``[node]nickname`` ``BASEDIR/nickname`` +``[node]web.port`` ``BASEDIR/webport`` +``[node]tub.port`` ``BASEDIR/client.port`` (for Clients, not Introducers) +``[node]tub.port`` ``BASEDIR/introducer.port`` (for Introducers, not Clients) (note that, unlike other keys, ``tahoe.cfg`` overrode this file from Tahoe-LAFS v1.3.0 up to and including Tahoe-LAFS v1.8.2) +``[node]tub.location`` ``BASEDIR/advertised_ip_addresses`` +``[node]log_gatherer.furl`` ``BASEDIR/log_gatherer.furl`` (one per line) +``[node]timeout.keepalive`` ``BASEDIR/keepalive_timeout`` +``[node]timeout.disconnect`` ``BASEDIR/disconnect_timeout`` +``[client]introducer.furl`` ``BASEDIR/introducer.furl`` +``[client]helper.furl`` ``BASEDIR/helper.furl`` +``[client]key_generator.furl`` ``BASEDIR/key_generator.furl`` +``[client]stats_gatherer.furl`` ``BASEDIR/stats_gatherer.furl`` +``[storage]enabled`` ``BASEDIR/no_storage`` (``False`` if ``no_storage`` exists) +``[storage]readonly`` ``BASEDIR/readonly_storage`` (``True`` if ``readonly_storage`` exists) +``[storage]sizelimit`` ``BASEDIR/sizelimit`` +``[storage]debug_discard`` ``BASEDIR/debug_discard_storage`` +``[helper]enabled`` ``BASEDIR/run_helper`` (``True`` if ``run_helper`` exists) +=============================== =================================== ================= + +Note: the functionality of ``[node]ssh.port`` and +``[node]ssh.authorized_keys_file`` were previously (before Tahoe-LAFS +v1.3.0) combined, controlled by the presence of a +``BASEDIR/authorized_keys.SSHPORT`` file, in which the suffix of the +filename indicated which port the ssh server should listen on, and the +contents of the file provided the ssh public keys to accept. Support +for these files has been removed completely. To ``ssh`` into your +Tahoe-LAFS node, add ``[node]ssh.port`` and +``[node].ssh_authorized_keys_file`` statements to your ``tahoe.cfg``. + +Likewise, the functionality of ``[node]tub.location`` is a variant of +the now (since Tahoe-LAFS v1.3.0) unsupported +``BASEDIR/advertised_ip_addresses`` . The old file was additive (the +addresses specified in ``advertised_ip_addresses`` were used in +addition to any that were automatically discovered), whereas the new +``tahoe.cfg`` directive is not (``tub.location`` is used verbatim). hunk ./docs/logging.rst 105 logfiles from multiple nodes (web-API, storage, or helper) in a single place. There are two kinds of gatherers. Both produce a FURL which needs to be -placed in the ``NODEDIR/log_gatherer.furl`` file (one FURL per line) of -each node that is to publish its logs to the gatherer. When the Tahoe node -starts, it will connect to the configured gatherers and offer its logport: -the gatherer will then use the logport to subscribe to hear about events. +placed in the ``NODEDIR/tahoe.cfg `` file of each node that is to publish +its logs to the gatherer. When the Tahoe node starts, it will connect to the +configured gatherers and offer its logport: the gatherer will then use the +logport to subscribe to hear about events. The gatherer will write to files in its working directory, which can then be examined with tools like "``flogtool dump``" as described above. hunk ./docs/logging.rst 171 things that happened on multiple machines (such as comparing a client node making a request with the storage servers that respond to that request). -The Log Gatherer is created with the "``flogtool create-gatherer WORKDIR``" -command, and started with "``tahoe start``". The ``log_gatherer.furl`` it -creates then needs to be copied into the ``BASEDIR/log_gatherer.furl`` file -of all nodes that should be sending it log events. +Create the Log Gatherer with the "``flogtool create-gatherer +WORKDIR``" command, and start it with "``tahoe start``". Then copy the +contents of the ``log_gatherer.furl`` file it creates into the +``BASEDIR/tahoe.cfg`` file (under the key ``log_gatherer.furl`` of the +section ``[node]``) of all nodes that should be sending it log +events. (See ``_.) The "``flogtool filter``" command, described above, is useful to cut down the hunk ./docs/logging.rst 179 -potentially-large flogfiles into more a narrowly-focussed form. +potentially large flogfiles into a more focussed form. Busy nodes, particularly web-API nodes which are performing recursive deep-size/deep-stats/deep-check operations, can produce a lot of log events. hunk ./src/allmydata/node.py 45 pass class MissingConfigEntry(Exception): - pass + """ A required config entry was not found. """ + +class OldConfigError(Exception): + """ An obsolete config file was found. See + docs/historical/configuration.rst. """ class Node(service.MultiService): # this implements common functionality of both Client nodes and Introducer hunk ./src/allmydata/node.py 115 assert self.config.get(section, option) == value def read_config(self): + self.warn_about_old_config_files() self.config = ConfigParser.SafeConfigParser() self.config.read([os.path.join(self.basedir, "tahoe.cfg")]) hunk ./src/allmydata/node.py 118 - self.read_old_config_files() hunk ./src/allmydata/node.py 119 - def read_old_config_files(self): - # backwards-compatibility: individual files will override the - # contents of tahoe.cfg - copy = self._copy_config_from_file + def warn_about_old_config_files(self): + """ If any old configuration files are detected, raise OldConfigError. """ hunk ./src/allmydata/node.py 122 - copy("nickname", "node", "nickname") - copy("webport", "node", "web.port") - - cfg_tubport = self.get_config("node", "tub.port", "") - if not cfg_tubport: - # For 'tub.port', tahoe.cfg overrides the individual file on - # disk. So only read self._portnumfile if tahoe.cfg doesn't - # provide a value. - try: - file_tubport = open(self._portnumfile, "rU").read().strip() - self.set_config("node", "tub.port", file_tubport) - except EnvironmentError: - pass - - copy("keepalive_timeout", "node", "timeout.keepalive") - copy("disconnect_timeout", "node", "timeout.disconnect") - - def _copy_config_from_file(self, config_filename, section, keyname): - s = self.get_config_from_file(config_filename) - if s is not None: - self.set_config(section, keyname, s) + oldfnames = set() + for name in [ + 'nickname', 'webport', 'keepalive_timeout', 'log_gatherer.furl', + 'disconnect_timeout', 'advertised_ip_addresses', 'introducer.furl', + 'helper.furl', 'key_generator.furl', 'stats_gatherer.furl', + 'no_storage', 'readonly_storage', 'sizelimit', + 'debug_discard_storage', 'run_helper']: + fullfname = os.path.join(self.basedir, name) + if os.path.exists(fullfname): + log.err("Found pre-Tahoe-LAFS-v1.3 configuration file: '%s'. See docs/historical/configuration.rst." % (fullfname,)) + oldfnames.add(fullfname) + if oldfnames: + raise OldConfigError(oldfnames) def create_tub(self): certfile = os.path.join(self.basedir, "private", self.CERTFILE) hunk ./src/allmydata/node.py 176 # TODO: merge this with allmydata.get_package_versions return dict(app_versions.versions) - def get_config_from_file(self, name, required=False): - """Get the (string) contents of a config file, or None if the file - did not exist. If required=True, raise an exception rather than - returning None. Any leading or trailing whitespace will be stripped - from the data.""" - fn = os.path.join(self.basedir, name) - try: - return open(fn, "r").read().strip() - except EnvironmentError: - if not required: - return None - raise - def write_private_config(self, name, value): """Write the (string) contents of a private config file (which is a config file that resides within the subdirectory named 'private'), and hunk ./src/allmydata/node.py 196 use it as a default value. If not, treat it as a 0-argument callable which is expected to return a string. """ - privname = os.path.join("private", name) - value = self.get_config_from_file(privname) - if value is None: - if isinstance(default, (str, unicode)): + privname = os.path.join(self.basedir, "private", name) + try: + value = fileutil.read(privname) + except EnvironmentError: + if isinstance(default, basestring): value = default else: value = default() hunk ./src/allmydata/node.py 204 - fn = os.path.join(self.basedir, privname) - try: - open(fn, "w").write(value) - except EnvironmentError, e: - self.log("Unable to write config file '%s'" % fn) - self.log(e) - value = value.strip() - return value + fileutil.write(privname, value) + return value.strip() def write_config(self, name, value, mode="w"): """Write a string to a config file.""" hunk ./src/allmydata/node.py 273 return self.stopService() def setup_logging(self): - # we replace the formatTime() method of the log observer that twistd - # set up for us, with a method that uses better timestamps. + # we replace the formatTime() method of the log observer that + # twistd set up for us, with a method that uses our preferred + # timestamp format. for o in twlog.theLogPublisher.observers: # o might be a FileLogObserver's .emit method if type(o) is type(self.setup_logging): # bound method hunk ./src/allmydata/test/common.py 378 iv_dir = self.getdir("introducer") if not os.path.isdir(iv_dir): fileutil.make_dirs(iv_dir) - f = open(os.path.join(iv_dir, "webport"), "w") - f.write("tcp:0:interface=127.0.0.1\n") - f.close() + fileutil.write(os.path.join(iv_dir, 'tahoe.cfg'), \ + "[node]\n" + \ + "web.port = tcp:0:interface=127.0.0.1\n") if SYSTEM_TEST_CERTS: os.mkdir(os.path.join(iv_dir, "private")) f = open(os.path.join(iv_dir, "private", "node.pem"), "w") hunk ./src/allmydata/test/common.py 456 f.write(SYSTEM_TEST_CERTS[i+1]) f.close() - def write(name, value): - open(os.path.join(basedir, name), "w").write(value+"\n") + config = "[client]\n" + config += "introducer.furl = %s\n" % self.introducer_furl + if self.stats_gatherer_furl: + config += "stats_gatherer.furl = %s\n" % self.stats_gatherer_furl + if i == 0: # clients[0] runs a webserver and a helper, no key_generator hunk ./src/allmydata/test/common.py 463 - write("webport", "tcp:0:interface=127.0.0.1") - write("run_helper", "yes") - write("keepalive_timeout", "600") + config += "[node]\n" + config += "web.port = tcp:0:interface=127.0.0.1\n" + config += "timeout.keepalive = 600\n" + config += "[helper]\n" + config += "enabled = True\n" if i == 3: # clients[3] runs a webserver and uses a helper, uses # key_generator hunk ./src/allmydata/test/common.py 471 - write("webport", "tcp:0:interface=127.0.0.1") - write("disconnect_timeout", "1800") if self.key_generator_furl: hunk ./src/allmydata/test/common.py 472 - kgf = "%s\n" % (self.key_generator_furl,) - write("key_generator.furl", kgf) - write("introducer.furl", self.introducer_furl) - if self.stats_gatherer_furl: - write("stats_gatherer.furl", self.stats_gatherer_furl) + config += "key_generator.furl = %s\n" % self.key_generator_furl + config += "[node]\n" + config += "web.port = tcp:0:interface=127.0.0.1\n" + config += "timeout.disconnect = 1800\n" + + fileutil.write(os.path.join(basedir, 'tahoe.cfg'), config) # give subclasses a chance to append lines to the node's tahoe.cfg # files before they are launched. hunk ./src/allmydata/test/common.py 495 f.close() self.helper_furl = helper_furl if self.numclients >= 4: - f = open(os.path.join(basedirs[3],"helper.furl"), "w") - f.write(helper_furl) + f = open(os.path.join(basedirs[3], 'tahoe.cfg'), 'ab+') + f.write( + "[client]\n" + "helper.furl = %s\n" % helper_furl) f.close() # this starts the rest of the clients hunk ./src/allmydata/test/common.py 558 basedir = self.getdir("client%d" % client_num) if not os.path.isdir(basedir): fileutil.make_dirs(basedir) - open(os.path.join(basedir, "introducer.furl"), "w").write(self.introducer_furl) + config = "[client]\n" + config += "introducer.furl = %s\n" % self.introducer_furl if helper_furl: hunk ./src/allmydata/test/common.py 561 - f = open(os.path.join(basedir, "helper.furl") ,"w") - f.write(helper_furl+"\n") - f.close() + config += "helper.furl = %s\n" % helper_furl + fileutil.write(os.path.join(basedir, 'tahoe.cfg'), config) c = client.Client(basedir=basedir) self.clients.append(c) hunk ./src/allmydata/test/test_client.py 5 import os from twisted.trial import unittest from twisted.application import service -from twisted.python import log import allmydata hunk ./src/allmydata/test/test_client.py 7 +from allmydata.node import OldConfigError from allmydata import client from allmydata.storage_client import StorageFarmBroker from allmydata.util import base32, fileutil hunk ./src/allmydata/test/test_client.py 16 from foolscap.api import flushEventualQueue import allmydata.test.common_util as testutil +import mock + BASECONFIG = ("[client]\n" "introducer.furl = \n" ) hunk ./src/allmydata/test/test_client.py 22 +BASECONFIG_I = ("[client]\n" + "introducer.furl = %s\n" + ) + class Basic(testutil.ReallyEqualMixin, unittest.TestCase): def test_loadable(self): basedir = "test_client.Basic.test_loadable" hunk ./src/allmydata/test/test_client.py 30 os.mkdir(basedir) - fileutil.write(os.path.join(basedir, "introducer.furl"), "") + fileutil.write(os.path.join(basedir, "tahoe.cfg"), \ + BASECONFIG) client.Client(basedir) hunk ./src/allmydata/test/test_client.py 34 - def test_loadable_old_config_bits(self): - basedir = "test_client.Basic.test_loadable_old_config_bits" + @mock.patch('allmydata.util.log.err') + def test_warn_on_old_config_files(self, mocklogerr): + basedir = "test_client.Basic.test_warn_on_old_config_files" os.mkdir(basedir) hunk ./src/allmydata/test/test_client.py 38 + fileutil.write(os.path.join(basedir, "tahoe.cfg"), \ + BASECONFIG + \ + "[storage]\n" + \ + "enabled = false\n" + \ + "reserved_space = bogus\n") fileutil.write(os.path.join(basedir, "introducer.furl"), "") fileutil.write(os.path.join(basedir, "no_storage"), "") fileutil.write(os.path.join(basedir, "readonly_storage"), "") hunk ./src/allmydata/test/test_client.py 47 fileutil.write(os.path.join(basedir, "debug_discard_storage"), "") - c = client.Client(basedir) - try: - c.getServiceNamed("storage") - self.fail("that was supposed to fail") - except KeyError: - pass + e = self.failUnlessRaises(OldConfigError, client.Client, basedir) + self.failUnlessIn(os.path.abspath(os.path.join(basedir, u"introducer.furl")), e.args[0]) + self.failUnlessIn(os.path.abspath(os.path.join(basedir, "no_storage")), e.args[0]) + self.failUnlessIn(os.path.abspath(os.path.join(basedir, "readonly_storage")), e.args[0]) + self.failUnlessIn(os.path.abspath(os.path.join(basedir, "debug_discard_storage")), e.args[0]) + for oldfile in [u'introducer.furl', 'no_storage', 'readonly_storage', + 'debug_discard_storage']: + warned = [ m for m in mocklogerr.call_args_list if ("Found pre-Tahoe-LAFS-v1.3 configuration file" in m[0][0] and oldfile in m[0][0]) ] + self.failUnless(warned, (oldfile, mocklogerr.call_args_list)) hunk ./src/allmydata/test/test_client.py 57 - def test_loadable_old_storage_config_bits(self): - basedir = "test_client.Basic.test_loadable_old_storage_config_bits" - os.mkdir(basedir) - fileutil.write(os.path.join(basedir, "introducer.furl"), "") - fileutil.write(os.path.join(basedir, "readonly_storage"), "") - fileutil.write(os.path.join(basedir, "debug_discard_storage"), "") - c = client.Client(basedir) - s = c.getServiceNamed("storage") - self.failUnless(s.no_storage) - self.failUnless(s.readonly_storage) + for oldfile in [ + 'nickname', 'webport', 'keepalive_timeout', 'log_gatherer.furl', + 'disconnect_timeout', 'advertised_ip_addresses', 'helper.furl', + 'key_generator.furl', 'stats_gatherer.furl', 'sizelimit', + 'run_helper']: + warned = [ m for m in mocklogerr.call_args_list if ("Found pre-Tahoe-LAFS-v1.3 configuration file" in m[0][0] and oldfile in m[0][0]) ] + self.failIf(warned, oldfile) def test_secrets(self): basedir = "test_client.Basic.test_secrets" hunk ./src/allmydata/test/test_client.py 68 os.mkdir(basedir) - fileutil.write(os.path.join(basedir, "introducer.furl"), "") + fileutil.write(os.path.join(basedir, "tahoe.cfg"), \ + BASECONFIG) c = client.Client(basedir) secret_fname = os.path.join(basedir, "private", "secret") self.failUnless(os.path.exists(secret_fname), secret_fname) hunk ./src/allmydata/test/test_client.py 151 def test_versions(self): basedir = "test_client.Basic.test_versions" os.mkdir(basedir) - fileutil.write(os.path.join(basedir, "introducer.furl"), "") + fileutil.write(os.path.join(basedir, "tahoe.cfg"), \ + BASECONFIG + \ + "[storage]\n" + \ + "enabled = true\n") c = client.Client(basedir) ss = c.getServiceNamed("storage") verdict = ss.remote_get_version() hunk ./src/allmydata/test/test_client.py 165 "non-numeric version in '%s'" % allmydata.__version__) all_versions = allmydata.get_package_versions_string() self.failUnless(allmydata.__appname__ in all_versions) - log.msg("tahoe versions: %s" % all_versions) # also test stats stats = c.get_stats() self.failUnless("node.uptime" in stats) hunk ./src/allmydata/test/test_client.py 191 basedir = "test_client.Run.test_loadable" os.mkdir(basedir) dummy = "pb://wl74cyahejagspqgy4x5ukrvfnevlknt@127.0.0.1:58889/bogus" - fileutil.write(os.path.join(basedir, "introducer.furl"), dummy) + fileutil.write(os.path.join(basedir, "tahoe.cfg"), BASECONFIG_I % dummy) fileutil.write(os.path.join(basedir, "suicide_prevention_hotline"), "") client.Client(basedir) hunk ./src/allmydata/test/test_client.py 199 basedir = "test_client.Run.test_reloadable" os.mkdir(basedir) dummy = "pb://wl74cyahejagspqgy4x5ukrvfnevlknt@127.0.0.1:58889/bogus" - fileutil.write(os.path.join(basedir, "introducer.furl"), dummy) + fileutil.write(os.path.join(basedir, "tahoe.cfg"), BASECONFIG_I % dummy) c1 = client.Client(basedir) c1.setServiceParent(self.sparent) hunk ./src/allmydata/test/test_runner.py 326 run_by_human=False) +BASECONFIG_I = ("[client]\n" + "introducer.furl = %s\n" + ) + class RunNode(common_util.SignalMixin, unittest.TestCase, pollmixin.PollMixin, RunBinTahoeMixin): # exercise "tahoe start", for both introducer, client node, and hunk ./src/allmydata/test/test_runner.py 475 # that even if the 'stop' command doesn't work (and the test fails), the client should # still terminate. open(HOTLINE_FILE, "w").write("") - open(os.path.join(c1, "introducer.furl"), "w").write("pb://xrndsskn2zuuian5ltnxrte7lnuqdrkz@127.0.0.1:55617/introducer\n") + fileutil.write(os.path.join(basedir, "tahoe.cfg"), BASECONFIG_I % "pb://xrndsskn2zuuian5ltnxrte7lnuqdrkz@127.0.0.1:55617/introducer") # now it's safe to start the node d.addCallback(_cb) hunk ./src/allmydata/test/test_runner.py 534 # that even if the 'stop' command doesn't work (and the test fails), the client should # still terminate. open(HOTLINE_FILE, "w").write("") - open(os.path.join(c1, "introducer.furl"), "w").write("pb://xrndsskn2zuuian5ltnxrte7lnuqdrkz@127.0.0.1:55617/introducer\n") + fileutil.write(os.path.join(c1, "tahoe.cfg"), BASECONFIG_I % "pb://xrndsskn2zuuian5ltnxrte7lnuqdrkz@127.0.0.1:55617/introducer") # now it's safe to start the node d.addCallback(_cb) } [whitespace-cleanup zooko@zooko.com**20110725015546 Ignore-this: 442970d0545183b97adc7bd66657876c ] { hunk ./docs/configuration.rst 253 used for files that usually (on a Unix system) go into ``/tmp``. The string will be interpreted relative to the node's base directory. + Client Configuration ==================== hunk ./docs/configuration.rst 328 (Mutable files use a different share placement algorithm that does not currently consider this parameter.) + Frontend Configuration ====================== hunk ./docs/configuration.rst 363 ``[sftpd]`` sections of ``tahoe.cfg``. + Storage Server Configuration ============================ hunk ./docs/configuration.rst 549 many people as possible, put the empty string (so that ``private/convergence`` is a zero-length file). + Other files =========== hunk ./src/allmydata/node.py 1 - import datetime, os.path, re, types, ConfigParser, tempfile from base64 import b32decode, b32encode hunk ./src/allmydata/node.py 67 # creates self.config, populates from distinct files if necessary self.read_config() - nickname_utf8 = self.get_config("node", "nickname", "") self.nickname = nickname_utf8.decode("utf-8") assert type(self.nickname) is unicode hunk ./src/allmydata/node.py 322 def add_service(self, s): s.setServiceParent(self) return s - hunk ./src/allmydata/test/common.py 341 def log(self, *args, **kwargs): return log.msg(*args, **kwargs) - class SystemTestMixin(pollmixin.PollMixin, testutil.StallMixin): # SystemTestMixin tests tend to be a lot of work, and we have a few hunk ./src/allmydata/test/test_client.py 1 - import os from twisted.trial import unittest from twisted.application import service hunk ./src/allmydata/test/test_runner.py 1 - from twisted.trial import unittest from twisted.python import usage, runtime } Context: [contrib: remove the contributed fuse modules and the entire contrib/ directory, which is now empty zooko@zooko.com**20110622224755 Ignore-this: 85f78620f33ec01c8e93c795a3d04ef7 Also remove a couple of vestigial references to figleaf, which is long gone. fixes #1409 (remove contrib/fuse) ] [Rename test_package_initialization.py to (much shorter) test_import.py . Brian Warner **20110611190234 Ignore-this: 3eb3dbac73600eeff5cfa6b65d65822 The former name was making my 'ls' listings hard to read, by forcing them down to just two columns. ] [tests: fix tests to accomodate [20110611153758-92b7f-0ba5e4726fb6318dac28fb762a6512a003f4c430] zooko@zooko.com**20110611163741 Ignore-this: 64073a5f39e7937e8e5e1314c1a302d1 Apparently none of the two authors (stercor, terrell), three reviewers (warner, davidsarah, terrell), or one committer (me) actually ran the tests. This is presumably due to #20. fixes #1412 ] [docs/running.rst: fix stray HTML (not .rst) link noticed by ChosenOne. david-sarah@jacaranda.org**20110609223719 Ignore-this: fc50ac9c94792dcac6f1067df8ac0d4a ] [wui: right-align the size column in the WUI zooko@zooko.com**20110611153758 Ignore-this: 492bdaf4373c96f59f90581c7daf7cd7 Thanks to Ted "stercor" Rolle Jr. and Terrell Russell. fixes #1412 ] [docs: three minor fixes zooko@zooko.com**20110610121656 Ignore-this: fec96579eb95aceb2ad5fc01a814c8a2 CREDITS for arc for stats tweak fix link to .zip file in quickstart.rst (thanks to ChosenOne for noticing) English usage tweak ] [server.py: get_latencies now reports percentiles _only_ if there are sufficient observations for the interpretation of the percentile to be unambiguous. wilcoxjg@gmail.com**20110527120135 Ignore-this: 2e7029764bffc60e26f471d7c2b6611e interfaces.py: modified the return type of RIStatsProvider.get_stats to allow for None as a return value NEWS.rst, stats.py: documentation of change to get_latencies stats.rst: now documents percentile modification in get_latencies test_storage.py: test_latencies now expects None in output categories that contain too few samples for the associated percentile to be unambiguously reported. fixes #1392 ] [corrected "k must never be smaller than N" to "k must never be greater than N" secorp@allmydata.org**20110425010308 Ignore-this: 233129505d6c70860087f22541805eac ] [docs: revert link in relnotes.txt from NEWS.rst to NEWS, since the former did not exist at revision 5000. david-sarah@jacaranda.org**20110517011214 Ignore-this: 6a5be6e70241e3ec0575641f64343df7 ] [docs: convert NEWS to NEWS.rst and change all references to it. david-sarah@jacaranda.org**20110517010255 Ignore-this: a820b93ea10577c77e9c8206dbfe770d ] [docs: remove out-of-date docs/testgrid/introducer.furl and containing directory. fixes #1404 david-sarah@jacaranda.org**20110512140559 Ignore-this: 784548fc5367fac5450df1c46890876d ] [scripts/common.py: don't assume that the default alias is always 'tahoe' (it is, but the API of get_alias doesn't say so). refs #1342 david-sarah@jacaranda.org**20110130164923 Ignore-this: a271e77ce81d84bb4c43645b891d92eb ] [setup: don't catch all Exception from check_requirement(), but only PackagingError and ImportError zooko@zooko.com**20110128142006 Ignore-this: 57d4bc9298b711e4bc9dc832c75295de I noticed this because I had accidentally inserted a bug which caused AssertionError to be raised from check_requirement(). ] [M-x whitespace-cleanup zooko@zooko.com**20110510193653 Ignore-this: dea02f831298c0f65ad096960e7df5c7 ] [docs: fix typo in running.rst, thanks to arch_o_median zooko@zooko.com**20110510193633 Ignore-this: ca06de166a46abbc61140513918e79e8 ] [relnotes.txt: don't claim to work on Cygwin (which has been untested for some time). refs #1342 david-sarah@jacaranda.org**20110204204902 Ignore-this: 85ef118a48453d93fa4cddc32d65b25b ] [relnotes.txt: forseeable -> foreseeable. refs #1342 david-sarah@jacaranda.org**20110204204116 Ignore-this: 746debc4d82f4031ebf75ab4031b3a9 ] [replace remaining .html docs with .rst docs zooko@zooko.com**20110510191650 Ignore-this: d557d960a986d4ac8216d1677d236399 Remove install.html (long since deprecated). Also replace some obsolete references to install.html with references to quickstart.rst. Fix some broken internal references within docs/historical/historical_known_issues.txt. Thanks to Ravi Pinjala and Patrick McDonald. refs #1227 ] [docs: FTP-and-SFTP.rst: fix a minor error and update the information about which version of Twisted fixes #1297 zooko@zooko.com**20110428055232 Ignore-this: b63cfb4ebdbe32fb3b5f885255db4d39 ] [munin tahoe_files plugin: fix incorrect file count francois@ctrlaltdel.ch**20110428055312 Ignore-this: 334ba49a0bbd93b4a7b06a25697aba34 fixes #1391 ] [Fix a test failure in test_package_initialization on Python 2.4.x due to exceptions being stringified differently than in later versions of Python. refs #1389 david-sarah@jacaranda.org**20110411190738 Ignore-this: 7847d26bc117c328c679f08a7baee519 ] [tests: add test for including the ImportError message and traceback entry in the summary of errors from importing dependencies. refs #1389 david-sarah@jacaranda.org**20110410155844 Ignore-this: fbecdbeb0d06a0f875fe8d4030aabafa ] [allmydata/__init__.py: preserve the message and last traceback entry (file, line number, function, and source line) of ImportErrors in the package versions string. fixes #1389 david-sarah@jacaranda.org**20110410155705 Ignore-this: 2f87b8b327906cf8bfca9440a0904900 ] [remove unused variable detected by pyflakes zooko@zooko.com**20110407172231 Ignore-this: 7344652d5e0720af822070d91f03daf9 ] [allmydata/__init__.py: Nicer reporting of unparseable version numbers in dependencies. fixes #1388 david-sarah@jacaranda.org**20110401202750 Ignore-this: 9c6bd599259d2405e1caadbb3e0d8c7f ] [update FTP-and-SFTP.rst: the necessary patch is included in Twisted-10.1 Brian Warner **20110325232511 Ignore-this: d5307faa6900f143193bfbe14e0f01a ] [control.py: remove all uses of s.get_serverid() warner@lothar.com**20110227011203 Ignore-this: f80a787953bd7fa3d40e828bde00e855 ] [web: remove some uses of s.get_serverid(), not all warner@lothar.com**20110227011159 Ignore-this: a9347d9cf6436537a47edc6efde9f8be ] [immutable/downloader/fetcher.py: remove all get_serverid() calls warner@lothar.com**20110227011156 Ignore-this: fb5ef018ade1749348b546ec24f7f09a ] [immutable/downloader/fetcher.py: fix diversity bug in server-response handling warner@lothar.com**20110227011153 Ignore-this: bcd62232c9159371ae8a16ff63d22c1b When blocks terminate (either COMPLETE or CORRUPT/DEAD/BADSEGNUM), the _shares_from_server dict was being popped incorrectly (using shnum as the index instead of serverid). I'm still thinking through the consequences of this bug. It was probably benign and really hard to detect. I think it would cause us to incorrectly believe that we're pulling too many shares from a server, and thus prefer a different server rather than asking for a second share from the first server. The diversity code is intended to spread out the number of shares simultaneously being requested from each server, but with this bug, it might be spreading out the total number of shares requested at all, not just simultaneously. (note that SegmentFetcher is scoped to a single segment, so the effect doesn't last very long). ] [immutable/downloader/share.py: reduce get_serverid(), one left, update ext deps warner@lothar.com**20110227011150 Ignore-this: d8d56dd8e7b280792b40105e13664554 test_download.py: create+check MyShare instances better, make sure they share Server objects, now that finder.py cares ] [immutable/downloader/finder.py: reduce use of get_serverid(), one left warner@lothar.com**20110227011146 Ignore-this: 5785be173b491ae8a78faf5142892020 ] [immutable/offloaded.py: reduce use of get_serverid() a bit more warner@lothar.com**20110227011142 Ignore-this: b48acc1b2ae1b311da7f3ba4ffba38f ] [immutable/upload.py: reduce use of get_serverid() warner@lothar.com**20110227011138 Ignore-this: ffdd7ff32bca890782119a6e9f1495f6 ] [immutable/checker.py: remove some uses of s.get_serverid(), not all warner@lothar.com**20110227011134 Ignore-this: e480a37efa9e94e8016d826c492f626e ] [add remaining get_* methods to storage_client.Server, NoNetworkServer, and warner@lothar.com**20110227011132 Ignore-this: 6078279ddf42b179996a4b53bee8c421 MockIServer stubs ] [upload.py: rearrange _make_trackers a bit, no behavior changes warner@lothar.com**20110227011128 Ignore-this: 296d4819e2af452b107177aef6ebb40f ] [happinessutil.py: finally rename merge_peers to merge_servers warner@lothar.com**20110227011124 Ignore-this: c8cd381fea1dd888899cb71e4f86de6e ] [test_upload.py: factor out FakeServerTracker warner@lothar.com**20110227011120 Ignore-this: 6c182cba90e908221099472cc159325b ] [test_upload.py: server-vs-tracker cleanup warner@lothar.com**20110227011115 Ignore-this: 2915133be1a3ba456e8603885437e03 ] [happinessutil.py: server-vs-tracker cleanup warner@lothar.com**20110227011111 Ignore-this: b856c84033562d7d718cae7cb01085a9 ] [upload.py: more tracker-vs-server cleanup warner@lothar.com**20110227011107 Ignore-this: bb75ed2afef55e47c085b35def2de315 ] [upload.py: fix var names to avoid confusion between 'trackers' and 'servers' warner@lothar.com**20110227011103 Ignore-this: 5d5e3415b7d2732d92f42413c25d205d ] [refactor: s/peer/server/ in immutable/upload, happinessutil.py, test_upload warner@lothar.com**20110227011100 Ignore-this: 7ea858755cbe5896ac212a925840fe68 No behavioral changes, just updating variable/method names and log messages. The effects outside these three files should be minimal: some exception messages changed (to say "server" instead of "peer"), and some internal class names were changed. A few things still use "peer" to minimize external changes, like UploadResults.timings["peer_selection"] and happinessutil.merge_peers, which can be changed later. ] [storage_client.py: clean up test_add_server/test_add_descriptor, remove .test_servers warner@lothar.com**20110227011056 Ignore-this: efad933e78179d3d5fdcd6d1ef2b19cc ] [test_client.py, upload.py:: remove KiB/MiB/etc constants, and other dead code warner@lothar.com**20110227011051 Ignore-this: dc83c5794c2afc4f81e592f689c0dc2d ] [test: increase timeout on a network test because Francois's ARM machine hit that timeout zooko@zooko.com**20110317165909 Ignore-this: 380c345cdcbd196268ca5b65664ac85b I'm skeptical that the test was proceeding correctly but ran out of time. It seems more likely that it had gotten hung. But if we raise the timeout to an even more extravagant number then we can be even more certain that the test was never going to finish. ] [docs/configuration.rst: add a "Frontend Configuration" section Brian Warner **20110222014323 Ignore-this: 657018aa501fe4f0efef9851628444ca this points to docs/frontends/*.rst, which were previously underlinked ] [web/filenode.py: avoid calling req.finish() on closed HTTP connections. Closes #1366 "Brian Warner "**20110221061544 Ignore-this: 799d4de19933f2309b3c0c19a63bb888 ] [Add unit tests for cross_check_pkg_resources_versus_import, and a regression test for ref #1355. This requires a little refactoring to make it testable. david-sarah@jacaranda.org**20110221015817 Ignore-this: 51d181698f8c20d3aca58b057e9c475a ] [allmydata/__init__.py: .name was used in place of the correct .__name__ when printing an exception. Also, robustify string formatting by using %r instead of %s in some places. fixes #1355. david-sarah@jacaranda.org**20110221020125 Ignore-this: b0744ed58f161bf188e037bad077fc48 ] [Refactor StorageFarmBroker handling of servers Brian Warner **20110221015804 Ignore-this: 842144ed92f5717699b8f580eab32a51 Pass around IServer instance instead of (peerid, rref) tuple. Replace "descriptor" with "server". Other replacements: get_all_servers -> get_connected_servers/get_known_servers get_servers_for_index -> get_servers_for_psi (now returns IServers) This change still needs to be pushed further down: lots of code is now getting the IServer and then distributing (peerid, rref) internally. Instead, it ought to distribute the IServer internally and delay extracting a serverid or rref until the last moment. no_network.py was updated to retain parallelism. ] [TAG allmydata-tahoe-1.8.2 warner@lothar.com**20110131020101] Patch bundle hash: 584a0f87f7de4920c327b29d845760eab9e6b5d1