]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Prevent magic-folder join if already joined.
authorDavid Stainton <dstainton415@gmail.com>
Thu, 5 Nov 2015 15:56:31 +0000 (16:56 +0100)
committermeejah <meejah@meejah.ca>
Wed, 20 Jan 2016 08:33:19 +0000 (01:33 -0700)
src/allmydata/scripts/magic_folder_cli.py

index e25f7b54166d859c1b1458cc7c18ec54f5a7ad19..245a9b6a6e42884ca7cbf98c14d3abf6a33ae036 100644 (file)
@@ -153,6 +153,9 @@ def join(options):
     dmd_cap_file = os.path.join(options["node-directory"], u"private", u"magic_folder_dircap")
     collective_readcap_file = os.path.join(options["node-directory"], u"private", u"collective_dircap")
 
+    if os.path.exists(dmd_cap_file) or os.path.exists(collective_readcap_file):
+        raise usage.UsageError("Cannot join. Already joined.")
+
     fileutil.write(dmd_cap_file, dmd_write_cap)
     fileutil.write(collective_readcap_file, magic_readonly_cap)