]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Add private config magic_folder_parent_dircap
authorDavid Stainton <dstainton415@gmail.com>
Tue, 2 Jun 2015 19:32:26 +0000 (12:32 -0700)
committerDaira Hopwood <daira@jacaranda.org>
Mon, 8 Jun 2015 23:02:20 +0000 (00:02 +0100)
- this commit also updates the tests

src/allmydata/client.py
src/allmydata/test/test_client.py

index 6f6e72675e5271512b9c0bf210d8e7d9160ce80c..90f25eeac82887848e3f9ba5cee459d3eee43187 100644 (file)
@@ -506,7 +506,13 @@ class Client(node.Node, pollmixin.PollMixin):
                 from allmydata.frontends import drop_upload
                 dbfile = os.path.join(self.basedir, "private", "magicfolderdb.sqlite")
                 dbfile = abspath_expanduser_unicode(dbfile)
-                s = drop_upload.DropUploader(self, upload_dircap, '', local_dir, dbfile)
+
+                magic_folder_parent_dircap = os.path.join(self.basedir, "private", "magic_folder_parent_dircap")
+                magic_folder_parent_dircap = abspath_expanduser_unicode(magic_folder_parent_dircap)
+                fh = open(magic_folder_parent_dircap, "r")
+                parent_dircap = fh.read().strip()
+
+                s = drop_upload.DropUploader(self, upload_dircap, parent_dircap, local_dir, dbfile)
                 s.setServiceParent(self)
                 s.startService()
 
index 48e87e67080637aeaabe30b7aa71a11ad44ab21a..6af25c526530ae72abff01f3e9075a526f04e7fa 100644 (file)
@@ -331,6 +331,7 @@ class Basic(testutil.ReallyEqualMixin, testutil.NonASCIIPathMixin, unittest.Test
 
         fileutil.write(os.path.join(basedir1, "tahoe.cfg"), config)
         fileutil.write(os.path.join(basedir1, "private", "drop_upload_dircap"), "URI:DIR2:blah")
+        fileutil.write(os.path.join(basedir1, "private", "magic_folder_parent_dircap"), "URI:DIR2:meow")
         self.failUnlessRaises(MissingConfigEntry, client.Client, basedir1)
 
         fileutil.write(os.path.join(basedir1, "tahoe.cfg"),
@@ -361,6 +362,7 @@ class Basic(testutil.ReallyEqualMixin, testutil.NonASCIIPathMixin, unittest.Test
                        "enabled = true\n" +
                        "local.directory = " + local_dir_utf8 + "\n")
         fileutil.write(os.path.join(basedir2, "private", "drop_upload_dircap"), "URI:DIR2:blah")
+        fileutil.write(os.path.join(basedir2, "private", "magic_folder_parent_dircap"), "URI:DIR2:meow")
         c2 = client.Client(basedir2)
         self.failUnlessRaises(KeyError, c2.getServiceNamed, 'drop-upload')
         self.failUnless([True for arg in mock_log_msg.call_args_list if "Boom" in repr(arg)],