From: Daira Hopwood Date: Mon, 6 Jul 2015 23:34:17 +0000 (+0100) Subject: Fixes to Magic Folder client initialization. X-Git-Url: https://git.rkrishnan.org/components/%22news.html/pb.xhtml?a=commitdiff_plain;h=0997af9de0670a6d0c861bcfa7d30b8975aa9ef1;p=tahoe-lafs%2Ftahoe-lafs.git Fixes to Magic Folder client initialization. Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/client.py b/src/allmydata/client.py index 9c47774a..dd5f8be9 100644 --- a/src/allmydata/client.py +++ b/src/allmydata/client.py @@ -498,31 +498,23 @@ class Client(node.Node, pollmixin.PollMixin): "See docs/frontends/magic-folder.rst for more information.") if self.get_config("magic_folder", "enabled", False, boolean=True): - upload_dircap = self.get_or_create_private_config("magic_folder_dircap") - upload_dircap is not None - # XXX correcto? - #local_dir_config = self.get_config("magic_folder", "local.directory").decode("utf-8") + upload_dircap = self.get_private_config("magic_folder_dircap") + collective_dircap = self.get_private_config("collective_dircap") + local_dir_config = self.get_config("magic_folder", "local.directory").decode("utf-8") local_dir = abspath_expanduser_unicode(local_dir_config, base=self.basedir) - try: - from allmydata.frontends import magic_folder - dbfile = os.path.join(self.basedir, "private", "magicfolderdb.sqlite") - dbfile = abspath_expanduser_unicode(dbfile) + dbfile = os.path.join(self.basedir, "private", "magicfolderdb.sqlite") + dbfile = abspath_expanduser_unicode(dbfile) - collective_dircap_path = os.path.join(self.basedir, "private", "collective_dircap") - collective_dircap_path = abspath_expanduser_unicode(collective_dircap_path) - collective_dircap = fileutil.read(collective_dircap_path).strip() - assert collective_dircap is not None + from allmydata.frontends import magic_folder - s = magic_folder.MagicFolder(self, upload_dircap, collective_dircap, local_dir, dbfile) - s.setServiceParent(self) - s.startService() + s = magic_folder.MagicFolder(self, upload_dircap, collective_dircap, local_dir, dbfile) + s.setServiceParent(self) + s.startService() - # start processing the upload queue when we've connected to enough servers - self.upload_ready_d.addCallback(s.ready) - except Exception, e: - self.log("couldn't start Magic Folder: %r", args=(e,)) + # start processing the upload queue when we've connected to enough servers + self.upload_ready_d.addCallback(s.ready) def _check_exit_trigger(self, exit_trigger_file): if os.path.exists(exit_trigger_file):