Beispiel #1
0
 def __init__(self):
     super(Giedo, self).__init__(settings.GIEDO_SOCKET)
     self.log = logging.getLogger('giedo')
     self.last_sync_ts = 0
     self.daan, self.cilia, self.moniek, self.hans = None, None, None, None
     try:
         self.daan = WhimClient(settings.DAAN_SOCKET)
     except Exception:
         self.log.exception("Couldn't connect to daan")
     try:
         self.cilia = WhimClient(settings.CILIA_SOCKET)
     except Exception:
         self.log.exception("Couldn't connect to cilia")
     try:
         self.moniek = WhimClient(settings.MONIEK_SOCKET)
     except Exception:
         self.log.exception("Couldn't connect to moniek")
     try:
         self.hans = WhimClient(settings.HANS_SOCKET)
     except Exception:
         self.log.exception("Couldn't connect to hans")
     self.mirte = mirte.get_a_manager()
     self.threadPool = self.mirte.get_a('threadPool')
     self.operation_lock = threading.Lock()
     self.ss_actions = (('postfix', self.daan, self._gen_postfix),
                        ('postfix-slm', self.daan, self._gen_postfix_slm),
                        ('mailman', self.hans, self._gen_mailman),
                        ('unix', self.cilia, self._gen_unix),
                        ('wiki', self.daan, self._gen_wiki),
                        ('ldap', self.daan,
                         self._gen_ldap), ('wolk', self.cilia,
                                           self._gen_wolk))
Beispiel #2
0
 def __init__(self):
     super(Giedo, self).__init__(settings.GIEDO_SOCKET)
     self.last_sync_ts = 0
     self.daan = WhimClient(settings.DAAN_SOCKET)
     self.cilia = WhimClient(settings.CILIA_SOCKET)
     self.mirte = mirte.get_a_manager()
     self.threadPool = self.mirte.get_a('threadPool')
     self.operation_lock = threading.Lock()
     self.push_changes_event = threading.Event()
     self.threadPool.execute(self.run_change_pusher)
     if default_storage.exists("villanet.pem"):
         self.villanet_key = RSA.load_pub_key(
             default_storage.path("villanet.pem"))
     self.ss_actions = (('postfix', self.daan, self._gen_postfix),
                        ('postfix-slm', self.daan, self._gen_postfix_slm),
                        ('mailman', self.daan, self._gen_mailman),
                        ('forum', self.daan, self._gen_forum),
                        ('unix', self.cilia, self._gen_unix),
                        ('wiki', self.daan,
                         self._gen_wiki), ('ldap', self.daan,
                                           self._gen_ldap))
     self.push_changes_event.set()
Beispiel #3
0
 def __init__(self):
     super(Giedo, self).__init__()
     self.log = logging.getLogger('giedo')
     self.last_sync_ts = 0
     self.daan, self.cilia, self.moniek, self.hans = None, None, None, None
     try:
         self.daan = daan_pb2_grpc.DaanStub(
             grpc.insecure_channel('unix:' + settings.DAAN_SOCKET))
     except Exception:
         self.log.exception("Couldn't connect to daan")
     try:
         self.cilia = WhimClient(settings.CILIA_SOCKET)
     except Exception:
         self.log.exception("Couldn't connect to cilia")
     try:
         self.moniek = moniek_pb2_grpc.MoniekStub(
             grpc.insecure_channel('unix:' + settings.MONIEK_SOCKET))
     except Exception:
         self.log.exception("Couldn't connect to moniek")
     try:
         self.hans = hans_pb2_grpc.HansStub(
             grpc.insecure_channel('unix:' + settings.HANS_SOCKET))
     except Exception:
         self.log.exception("Couldn't connect to hans")
     self.mirte = mirte.get_a_manager()
     self.threadPool = self.mirte.get_a('threadPool')
     self.operation_lock = threading.Lock()
     self.ss_actions = (('postfix', self.daan.SetPostfixMap,
                         self._gen_postfix),
                        ('postfix-slm', self.daan.SetPostfixSenderLoginMap,
                         self._gen_postfix_slm),
                        ('mailman', self.hans.ApplyChanges,
                         self._gen_mailman), ('unix', self.cilia.send,
                                              self._gen_unix),
                        ('wiki', self.daan.ApplyWikiChanges,
                         self._gen_wiki),
                        ('ldap', self.daan.ApplyLDAPChanges,
                         self._gen_ldap), ('wolk', self.cilia.send,
                                           self._gen_wolk))
Beispiel #4
0
def get_giedo_connection():
    global __GIEDO
    if __GIEDO is None:
        __GIEDO = WhimClient(settings.GIEDO_SOCKET)
    return __GIEDO