mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-24 15:16:41 +00:00
Prevent magic-folder join if already joined.
This commit is contained in:
parent
6b4d3b8c6d
commit
aea2cf2890
@ -153,6 +153,9 @@ def join(options):
|
|||||||
dmd_cap_file = os.path.join(options["node-directory"], u"private", u"magic_folder_dircap")
|
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")
|
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(dmd_cap_file, dmd_write_cap)
|
||||||
fileutil.write(collective_readcap_file, magic_readonly_cap)
|
fileutil.write(collective_readcap_file, magic_readonly_cap)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user