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

Closed
opened 2010-10-30 19:24:39 +00:00 by francois · 7 comments
francois commented 2010-10-30 19:24:39 +00:00
Owner
$ 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._dispatchoptMangled(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](wiki/BackupConfigurationError)('Error opening exclude file %r.' % filepath)
allmydata.scripts.cli.BackupConfigurationError: Error opening exclude file '~/.tahoe/excludes'.
``` $ 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._dispatchoptMangled(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](wiki/BackupConfigurationError)('Error opening exclude file %r.' % filepath) allmydata.scripts.cli.BackupConfigurationError: Error opening exclude file '~/.tahoe/excludes'. ```
tahoe-lafs added the
code-frontend-cli
minor
enhancement
1.8.0
labels 2010-10-30 19:24:39 +00:00
tahoe-lafs added this to the 1.8.1 milestone 2010-10-30 19:24:39 +00:00
francois commented 2010-10-30 21:10:04 +00:00
Author
Owner

Attachment patch-1241.dpatch (23230 bytes) added

**Attachment** patch-1241.dpatch (23230 bytes) added
francois commented 2010-10-30 21:13:02 +00:00
Author
Owner

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

This patch implements tilde expansion for the `tahoe backup` `--exclude-from` option. A unit test is also included.
davidsarah commented 2010-10-31 04:03:59 +00:00
Author
Owner

Attachment exclude-from-tilde-expansion.darcs.patch (13198 bytes) added

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

**Attachment** exclude-from-tilde-expansion.darcs.patch (13198 bytes) added tahoe backup: perform tilde expansion in exclude-from filename. fixes #1241
davidsarah commented 2010-10-31 04:07:37 +00:00
Author
Owner

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.

The unit test in [patch-1241.dpatch](/tahoe-lafs/trac-2024-07-25/attachments/000078ac-435d-da8a-faef-2ba2b944b31c) 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](/tahoe-lafs/trac-2024-07-25/attachments/000078ac-435d-da8a-faef-a73565adb829), I've changed the unit test to use the 'mock' module to confirm that `file` is being called with the expected argument.
davidsarah commented 2010-10-31 04:17:03 +00:00
Author
Owner

Attachment exclude-from-tilde-expansion-2.darcs.patch (13058 bytes) added

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

**Attachment** exclude-from-tilde-expansion-2.darcs.patch (13058 bytes) added tahoe backup: perform tilde expansion in exclude-from filename (version 2). fixes #1241
zooko commented 2010-10-31 04:19:50 +00:00
Author
Owner

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

I reviewed [exclude-from-tilde-expansion-2.darcs.patch](/tahoe-lafs/trac-2024-07-25/attachments/000078ac-435d-da8a-faef-e836fda7351f) and the test in it seems correct. Also the code itself. :-)
davidsarah commented 2010-11-02 02:24:06 +00:00
Author
Owner

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

Fixed in changeset:6eaa7f2356881f16. (There was apparently a problem submitting this changeset to trac, but the trac history has been rebuilt since.)
tahoe-lafs added the
fixed
label 2010-11-02 02:24:06 +00:00
davidsarah closed this issue 2010-11-02 02:24:06 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tahoe-lafs/trac-2024-07-25#1241
No description provided.