#1333 assigned defect

'private/' subdir of BASEDIR should be created during 'tahoe create-alias' and friends — at Version 3

Reported by: warner Owned by:
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 (3)

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

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).

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.

Note: See TracTickets for help on using tickets.