#2454 closed task (fixed)
Magic Folder: add create commandline tool
Reported by: | dawuud | Owned by: | daira |
---|---|---|---|
Priority: | normal | Milestone: | 1.12.0 |
Component: | code-frontend-magic-folder | Version: | 1.10.0 |
Keywords: | otf-magic-folder-objective6 | Cc: | |
Launchpad Bug: |
Description (last modified by daira)
Implement a basic magic folder DMD creation command:
tahoe magic-folder create MAGIC:
This command will depend on the invite and join commands for the other usage:
tahoe magic-folder create MAGIC: [MY_NICKNAME LOCAL_DIR]
Change History (19)
comment:1 Changed at 2015-06-15T17:03:23Z by dawuud
- Description modified (diff)
- Keywords magic folder magic-folder added
- Summary changed from Magic Folder: add to Magic Folder: add magic folder create commandline tool
comment:2 Changed at 2015-06-15T17:04:23Z by dawuud
- Keywords otf-magic-folder-objective6 added
comment:3 Changed at 2015-06-15T17:40:35Z by dawuud
- Owner changed from daira to dawuud
- Summary changed from Magic Folder: add magic folder create commandline tool to Magic Folder: add create commandline tool
- Type changed from defect to task
comment:4 Changed at 2015-06-15T23:19:34Z by dawuud
comment:5 Changed at 2015-06-16T23:17:01Z by dawuud
i'm having trouble getting my unit test for the create command to pass. here's my work in progress commit... it's test fails. the test name is called:
allmydata.test.test_cli_magic_folder
https://github.com/david415/tahoe-lafs/commit/626f3447a61be466e126bd04dbc39a4696fe0da9
comment:6 Changed at 2015-06-18T22:09:39Z by dawuud
but why still fail!?
` [user@tahoe-dev1 tahoe-lafs]$ ./bin/tahoe debug trial allmydata.test.test_cli_magic_folder allmydata.test.test_cli_magic_folder
test_create ... [ERROR]
=============================================================================== [ERROR] Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/twisted/python/threadpool.py", line 196, in _worker
result = context.call(ctx, function, *args, kwargs)
File "/usr/lib64/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, kw)
File "/usr/lib64/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
return func(*args,kw)
File "/home/user/tahoe-lafs/src/allmydata/scripts/runner.py", line 148, in runner
rc = magic_folder_cli.dispatch[command](so)
File "/home/user/tahoe-lafs/src/allmydata/scripts/magic_folder_cli.py", line 66, in do_magic_folder
return f(so)
File "/home/user/tahoe-lafs/src/allmydata/scripts/magic_folder_cli.py", line 20, in create
rc = tahoe_add_alias.create_alias(options)
File "/home/user/tahoe-lafs/src/allmydata/scripts/tahoe_add_alias.py", line 57, in create_alias
nodedir = optionsnode-directory?
exceptions.KeyError?: 'node-directory'
allmydata.test.test_cli_magic_folder.CreateMagicFolder?.test_create
Ran 1 tests in 0.368s
FAILED (errors=1) [user@tahoe-dev1 tahoe-lafs]$
`
comment:7 follow-up: ↓ 16 Changed at 2015-06-19T05:27:22Z by dawuud
Question to Tahoe-LAFS developers: why does CreateAliasOptions? inherit from FilesystemOptions??
Shouldn't it inherit from BasedirOptions? instead?
What does it even mean to use the create alias CLI when only a node-url is specified but a node-directory is not? How will it persist the alias to the aliases file?
comment:8 Changed at 2015-06-19T05:28:05Z by dawuud
- Owner changed from dawuud to daira
comment:9 Changed at 2015-06-19T06:09:12Z by dawuud
comment:10 Changed at 2015-06-19T06:13:33Z by dawuud
- Owner changed from daira to dawuud
comment:11 Changed at 2015-06-19T09:58:13Z by dawuud
currently this basic magic-folder create command only creates an alias... the other usage will have to wait until i finish the join and invite commands.
comment:12 Changed at 2015-06-23T09:23:29Z by dawuud
completed the join and invite functionality of the create command: https://github.com/david415/tahoe-lafs/commit/6cde4dc88840bd76d9c0999a9df0ed91f980b04a
unit tests coming soon...
comment:13 Changed at 2015-06-24T00:21:20Z by dawuud
- Owner changed from dawuud to daira
completed unit tests... tied them all together with the join unit tests which look at the magic folder structure.
please review.
comment:14 Changed at 2015-07-07T18:47:40Z by daira
- Component changed from unknown to code-frontend-magic-folder
- Keywords review-needed added; magic folder magic-folder removed
- Status changed from new to assigned
comment:15 Changed at 2015-07-07T18:48:27Z by daira
- Description modified (diff)
comment:16 in reply to: ↑ 7 Changed at 2015-07-07T18:50:46Z by daira
Replying to dawuud:
Question to Tahoe-LAFS developers: why does CreateAliasOptions inherit from FilesystemOptions?
Because tahoe create-alias accesses the filesystem! (It creates a directory.)
comment:17 Changed at 2015-07-15T00:34:42Z by daira
- Keywords review-needed removed
We finished reviewing this today (see https://github.com/tahoe-lafs/tahoe-lafs/pull/174/files).
comment:18 Changed at 2015-08-21T14:36:22Z by daira
- Milestone changed from undecided to 1.11.0
- Resolution set to fixed
- Status changed from assigned to closed
This is implemented and tested.
comment:19 Changed at 2016-03-22T05:02:52Z by warner
- Milestone changed from 1.11.0 to 1.12.0
Milestone renamed
here i've written to the boiler plate code for the magic-folder CLI subcommand system...
this commit also has naive/basic command usage for the magic-folder create command:
https://github.com/david415/tahoe-lafs/tree/2454.magic-folder-create-tool.1 https://github.com/david415/tahoe-lafs/commit/cb33d9a1486ffc6250708feca6ed0c6cfad1bf81