#1548 new enhancement

separate configuration from instantiation of Client instance

Reported by: zooko Owned by: zooko
Priority: normal Milestone: soon
Component: code-nodeadmin Version: 1.9.0a2
Keywords: configuration cleanup Cc:
Launchpad Bug:

Description

I'm writing tests of configuration, and currently reading values from the configuration and using them is done inside the constructor of Client. I would rather there be some separate code that reads the values from configuration and does whatever validation and parsing is necessary and then passes all configuration options as arguments to the constructor of the class. This would be as prescribed in the CodingStandards document.

Attachments (2)

renameClient.dpatch (6.5 KB) - added by zooko at 2011-09-27T20:01:41Z.
1548-fix-missing-rename.darcs.patch (7.6 KB) - added by davidsarah at 2011-09-27T22:09:17Z.
test/test_upload.py: fix a missing rename of client to clientandserver. refs #1548 (Includes previous patch.)

Download all attachments as: .zip

Change History (12)

comment:1 Changed at 2011-09-26T21:10:36Z by zooko

  • Status changed from new to assigned

comment:2 Changed at 2011-09-27T20:01:02Z by zooko

Here is a patch to rename Client to ClientAndServer and to put a little shim into place so that .tac files can continue invoking allmydata.client.Client.

Changed at 2011-09-27T20:01:41Z by zooko

comment:3 Changed at 2011-09-27T22:01:18Z by davidsarah

attachment:renameClient.dpatch causes this test failure (looks like just a missing rename):

[ERROR]: allmydata.test.test_upload

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/twisted/trial/runner.py", line 584, in loadPackage
    module = modinfo.load()
  File "/usr/lib/python2.6/dist-packages/twisted/python/modules.py", line 383, in load
    return self.pathEntry.pythonPath.moduleLoader(self.name)
  File "/usr/lib/python2.6/dist-packages/twisted/python/reflect.py", line 464, in namedAny
    topLevelPackage = _importAndCheckStack(trialname)
  File "/usr/lib/python2.6/dist-packages/twisted/python/reflect.py", line 400, in _importAndCheckStack
    return __import__(importName)
  File "/home/davidsarah/tahoe/ticket999-S3-backend/src/allmydata/test/test_upload.py", line 186, in <module>
    class FakeClient:
  File "/home/davidsarah/tahoe/ticket999-S3-backend/src/allmydata/test/test_upload.py", line 209, in FakeClient
    _secret_holder = client.SecretHolder("lease secret", "convergence secret")
exceptions.AttributeError: 'module' object has no attribute 'SecretHolder'
-------------------------------------------------------------------------------

Changed at 2011-09-27T22:09:17Z by davidsarah

test/test_upload.py: fix a missing rename of client to clientandserver. refs #1548 (Includes previous patch.)

comment:4 Changed at 2012-03-29T19:28:00Z by davidsarah

  • Priority changed from major to normal

comment:5 Changed at 2013-10-14T18:39:59Z by zooko

  • Keywords review-needed added
  • Owner changed from zooko to nobody
  • Status changed from assigned to new

Hm, what's the status of this patch? Is it ready for code review?

comment:6 Changed at 2013-10-17T15:19:13Z by daira

  • Keywords review-needed removed
  • Milestone changed from undecided to 1.12.0
  • Owner changed from nobody to zooko

I'd forgotten all about this ticket. The patch will need redoing for git, but I approve in principle of making this change after 1.11.

comment:7 Changed at 2016-03-22T05:02:25Z by warner

  • Milestone changed from 1.12.0 to 1.13.0

Milestone renamed

comment:8 Changed at 2016-06-28T18:17:14Z by warner

  • Milestone changed from 1.13.0 to 1.14.0

renaming milestone

comment:9 Changed at 2020-06-30T14:45:13Z by exarkun

  • Milestone changed from 1.14.0 to 1.15.0

Moving open issues out of closed milestones.

comment:10 Changed at 2021-03-30T18:40:19Z by meejah

  • Milestone changed from 1.15.0 to soon

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.