else:
raise usage.UsageError("No default basedir available, you must provide one with --node-directory, --basedir, or a basedir argument")
self['basedir'] = b
+ self['node-directory'] = b
def postOptions(self):
if not self['basedir']:
+import os
+
from twisted.python import usage, failure
from allmydata.scripts.common import BaseOptions
from .common import BaseOptions, BasedirOptions
class CreateOptions(BasedirOptions):
nickname = None
localdir = None
+ synopsis = "MAGIC_ALIAS: [NICKNAME LOCALDIR]"
def parseArgs(self, alias, nickname=None, localdir=None):
BasedirOptions.parseArgs(self)
self.alias = alias
self.localdir = localdir
if self.nickname and not self.localdir:
raise usage.UsageError("must provide both")
- synopsis = "MAGIC_ALIAS: [NICKNAME LOCALDIR]"
+ node_url_file = os.path.join(self['node-directory'], "node.url")
+ self['node-url'] = open(node_url_file, "r").read().strip()
def create(options):
from allmydata.scripts import tahoe_add_alias
rc = tahoe_add_alias.create_alias(options)
- #print "node dir %s" % (options['node-directory'],)
return rc
class InviteOptions(BasedirOptions):