Fixes to Magic Folder client initialization.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2015-07-07 00:34:17 +01:00
parent 31d6430d10
commit 32cad77b95

View File

@ -498,22 +498,16 @@ 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)
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)
@ -521,8 +515,6 @@ class Client(node.Node, pollmixin.PollMixin):
# 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,))
def _check_exit_trigger(self, exit_trigger_file):
if os.path.exists(exit_trigger_file):