mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-23 23:02:25 +00:00
teach leave to: remove magic_folder section of config
This commit is contained in:
parent
d6e68129ab
commit
b4b5590b00
@ -172,9 +172,19 @@ class LeaveOptions(BasedirOptions):
|
||||
BasedirOptions.parseArgs(self)
|
||||
|
||||
def leave(options):
|
||||
from ConfigParser import SafeConfigParser
|
||||
|
||||
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")
|
||||
|
||||
parser = SafeConfigParser()
|
||||
parser.read(os.path.join(options["node-directory"], u"tahoe.cfg"))
|
||||
parser.remove_section("magic_folder")
|
||||
f = open(os.path.join(options["node-directory"], u"tahoe.cfg"), "w")
|
||||
parser.write(f)
|
||||
f.close()
|
||||
|
||||
for f in [dmd_cap_file, collective_readcap_file, magic_folder_db_file]:
|
||||
try:
|
||||
os.remove(f)
|
||||
|
Loading…
Reference in New Issue
Block a user