Commit c6aaaa8b authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Added TODO. Removed unused imports removed zmprov.std[in,out].close() and zmprov.terminate().

parent 516b1de5
import managementagent.rabbitmodules
import managementagent.utils
import os
import os.path
import logging
import re
import shutil
import subprocess
import pwd
import stat
import managementagent.rabbitmodules
import managementagent.utils
__author__ = 'Rafael Ostertag <rafael.ostertag@math.uzh.ch>'
logger = logging.getLogger(__name__)
class EmailList(managementagent.RabbitModule):
"""Handling a ping request"""
"""Use Zimbra zmprov to maintain mailinglists
TODO: Return error messages produced by zmprov.
"""
def __init__(self):
super(EmailList, self).__init__('EmailList', 'emaillist', 1)
......@@ -36,10 +36,6 @@ class EmailList(managementagent.RabbitModule):
zmprov_lines.append(op + " " + operation['name'] + "\n")
zmprov.communicate(input="".join(zmprov_lines))
zmprov.stdin.close()
zmprov.stdout.close()
zmprov.terminate()
def _process_members_operations(self, members_operations):
zmprov = subprocess.Popen(EmailList.ZIMBRA_ZMPROV, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
......@@ -62,11 +58,6 @@ class EmailList(managementagent.RabbitModule):
zmprov.communicate(input="".join(zmprov_lines))
zmprov.stdin.close()
zmprov.stdout.close()
zmprov.terminate()
def process_message(self, message):
instructions = message.body
......@@ -88,5 +79,6 @@ class EmailList(managementagent.RabbitModule):
ZIMBRA_ZMPROV = '/opt/zimbra/bin/zmprov'
def initialize():
return EmailList().identification()
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment