#1241 closed enhancement (fixed)

'tahoe backup' should do perform tilde expansion on its '--exclude-from' parameter

Reported by: francois Owned by: zooko
Priority: minor Milestone: 1.8.1
Component: code-frontend-cli Version: 1.8.0
Keywords: tahoe-backup reviewed Cc:
Launchpad Bug:

Description

$ tahoe backup --exclude-from=~/.tahoe/excludes -v ~ tahoe:
Traceback (most recent call last):
  File "/home/francois/dev/tahoe/support/bin/tahoe", line 9, in <module>
    load_entry_point('allmydata-tahoe==1.8.0-r4784', 'console_scripts', 'tahoe')()
  File "/home/francois/dev/tahoe/src/allmydata/scripts/runner.py", line 114, in run
    rc = runner(sys.argv[1:], install_node_control=install_node_control)
  File "/home/francois/dev/tahoe/src/allmydata/scripts/runner.py", line 65, in runner
    config.parseOptions(argv)
  File "/usr/lib/python2.5/site-packages/twisted/python/usage.py", line 231, in parseOptions
    self.subOptions.parseOptions(rest)
  File "/usr/lib/python2.5/site-packages/twisted/python/usage.py", line 219, in parseOptions
    self._dispatch[optMangled](optMangled, arg)
  File "/usr/lib/python2.5/site-packages/twisted/python/usage.py", line 373, in <lambda>
    fn = lambda name, value, m=method: m(value)
  File "/home/francois/dev/tahoe/src/allmydata/scripts/cli.py", line 313, in opt_exclude_from
    raise BackupConfigurationError('Error opening exclude file %r.' % filepath)
allmydata.scripts.cli.BackupConfigurationError: Error opening exclude file '~/.tahoe/excludes'.

Attachments (3)

patch-1241.dpatch (22.7 KB) - added by francois at 2010-10-30T21:10:04Z.
exclude-from-tilde-expansion.darcs.patch (12.9 KB) - added by davidsarah at 2010-10-31T04:03:59Z.
tahoe backup: perform tilde expansion in exclude-from filename. fixes #1241
exclude-from-tilde-expansion-2.darcs.patch (12.8 KB) - added by davidsarah at 2010-10-31T04:17:03Z.
tahoe backup: perform tilde expansion in exclude-from filename (version 2). fixes #1241

Download all attachments as: .zip

Change History (8)

Changed at 2010-10-30T21:10:04Z by francois

comment:1 Changed at 2010-10-30T21:11:24Z by francois

  • Keywords tahoe-backup review-needed added

comment:2 Changed at 2010-10-30T21:13:02Z by francois

This patch implements tilde expansion for the tahoe backup --exclude-from option. A unit test is also included.

Changed at 2010-10-31T04:03:59Z by davidsarah

tahoe backup: perform tilde expansion in exclude-from filename. fixes #1241

comment:3 Changed at 2010-10-31T04:07:37Z by davidsarah

  • Owner set to zooko

The unit test in patch-1241.dpatch didn't really test the right thing, since it would have passed even if abspath_expanduser_unicode hadn't been applied in cli.py.

In exclude-from-tilde-expansion.darcs.patch, I've changed the unit test to use the 'mock' module to confirm that file is being called with the expected argument.

Changed at 2010-10-31T04:17:03Z by davidsarah

tahoe backup: perform tilde expansion in exclude-from filename (version 2). fixes #1241

comment:4 Changed at 2010-10-31T04:19:50Z by zooko

  • Keywords reviewed added; review-needed removed

I reviewed attachment:exclude-from-tilde-expansion-2.darcs.patch and the test in it seems correct. Also the code itself. :-)

comment:5 Changed at 2010-11-02T02:24:06Z by davidsarah

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in 6eaa7f2356881f16. (There was apparently a problem submitting this changeset to trac, but the trac history has been rebuilt since.)

Note: See TracTickets for help on using tickets.