Opened at 2011-01-20T03:32:33Z
Last modified at 2021-03-30T18:40:19Z
#1333 assigned defect
'private/' subdir of BASEDIR should be created during 'tahoe create-alias' and friends
Reported by: | warner | Owned by: | Lcstyle |
---|---|---|---|
Priority: | minor | Milestone: | soon |
Component: | code-nodeadmin | Version: | 1.8.1 |
Keywords: | easy | Cc: | |
Launchpad Bug: |
Description (last modified by Lcstyle)
user 'munderwo' on the IRC channel noticed an exception when they manually deleted their ~/.tahoe directory, then re-created it, then ran tahoe create-alias. It complained that the ~/.tahoe/private directory did not exist, which trying to write aliases.tmp.
I suspect that we create this directory during tahoe create-client, but then assume that it exists later. Instead, if tahoe create-alias notices that it is missing, it should just re-mkdir it.
Change History (9)
comment:1 Changed at 2011-01-20T03:42:58Z by warner
- Description modified (diff)
comment:2 Changed at 2012-01-04T21:48:08Z by warner
comment:3 Changed at 2014-09-27T02:14:14Z by Lcstyle
- Description modified (diff)
If the issue is still present, I think I can tackle this one, please assign.
comment:4 Changed at 2014-09-27T03:13:12Z by Lcstyle
- Owner set to Lcstyle
- Status changed from new to assigned
comment:5 Changed at 2014-09-27T03:20:26Z by Lcstyle
- Milestone changed from undecided to 1.12.0
comment:6 Changed at 2016-03-22T05:02:25Z by warner
- Milestone changed from 1.12.0 to 1.13.0
Milestone renamed
comment:7 Changed at 2016-06-28T18:17:14Z by warner
- Milestone changed from 1.13.0 to 1.14.0
renaming milestone
comment:8 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:9 Changed at 2021-03-30T18:40:19Z by meejah
- Milestone changed from 1.15.0 to soon
Ticket retargeted after milestone closed
discussing this on IRC just now, we agreed that both create-alias and add-alias are allowed to require the pre-existence of NODEDIR and NODEDIR/node.url, but both should os.mkdir(NODEDIR/private) when necessary.
It'd be polite if both commands, when faced with a missing NODEDIR or NODEDIR/node.url, were to tell the user (in the error message) that they should create them, rather than throwing a weird exception that's hard to understand. But that's not strictly necessary to resolve this ticket.
The main code changes will go into src/allmydata/scripts/tahoe_add_alias.py. The unit test should probably be added to the end of CreateAlias.test_create in source:src/allmydata/test/test_cli.py , and should clobber private/ and then re-run tahoe create-alias and verify the results (by reading the alias file). It might be a good idea to test add-alias too, which is a bit easier (it doesn't need to talk to an actual node).