mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-05 08:34:30 +00:00
Scripts/openchange_cleanup.py: don't use subprocess.check_output
since it it not available in py2.6 Actually use imapport + imaphost Monotone-Parent: a223e7453cba5fece9978e8b04d3890c9d290735 Monotone-Revision: 631650bf7e67489a8bf42e8edf637b07f298ec39 Monotone-Author: jraby@inverse.ca Monotone-Date: 2012-09-04T18:49:48 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -64,9 +64,9 @@ def main():
|
||||
|
||||
# cleanup starts here
|
||||
try:
|
||||
imapCleanup(username, userpass)
|
||||
imapCleanup(imaphost, imapport, username, userpass)
|
||||
except Exception as e:
|
||||
print "Error during imapCleanup, continuing: %s" % (e.value)
|
||||
print "Error during imapCleanup, continuing: %s" % str(e)
|
||||
|
||||
try:
|
||||
mapistoreCleanup(mapistorefolder, username)
|
||||
@@ -129,7 +129,7 @@ def cleanupmb(mb, client):
|
||||
else:
|
||||
print "mailbox '%s' coult NOT be deleted (code = '%s')" % (mb, code)
|
||||
|
||||
def imapCleanup(username, userpass) :
|
||||
def imapCleanup(imaphost, imapport, username, userpass) :
|
||||
|
||||
client = imaplib.IMAP4(imaphost, imapport)
|
||||
(code, data) = client.login(username, userpass)
|
||||
@@ -182,8 +182,10 @@ def postgresqlCleanup(dbhost, dbport, dbuser, dbpass, dbname, username):
|
||||
print "table '%s' emptied" % tablename
|
||||
|
||||
def getOCSFolderInfoURL():
|
||||
# hack
|
||||
defaultsout = subprocess.check_output(["defaults", "read", "sogod", "OCSFolderInfoURL"])
|
||||
# hack
|
||||
# this doesn't work in py2.6 ...
|
||||
#defaultsout = subprocess.check_output(["defaults", "read", "sogod", "OCSFolderInfoURL"])
|
||||
defaultsout = subprocess.Popen(["defaults", "read", "sogod", "OCSFolderInfoURL"], stdout=subprocess.PIPE).communicate()[0]
|
||||
|
||||
OCSFolderInfoURL = defaultsout.split()[-1]
|
||||
return OCSFolderInfoURL
|
||||
|
||||
Reference in New Issue
Block a user