Teach join to also check for existing magicfolder db file
authorDavid Stainton <dstainton415@gmail.com>
Thu, 5 Nov 2015 16:09:17 +0000 (17:09 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Mon, 28 Dec 2015 15:32:37 +0000 (15:32 +0000)
src/allmydata/scripts/magic_folder_cli.py

index 245a9b6a6e42884ca7cbf98c14d3abf6a33ae036..7b63a70d5b73c14df54fa8743a772941a4aaa121 100644 (file)
@@ -152,8 +152,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")
+    magic_folder_db_file = os.path.join(options["node-directory"], u"private", u"magicfolderdb.sqlite")
 
-    if os.path.exists(dmd_cap_file) or os.path.exists(collective_readcap_file):
+    if os.path.exists(dmd_cap_file) or os.path.exists(collective_readcap_file) or os.path.exists(magic_folder_db_file):
         raise usage.UsageError("Cannot join. Already joined.")
 
     fileutil.write(dmd_cap_file, dmd_write_cap)