Exemplo n.º 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))
Exemplo n.º 2
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))
Exemplo n.º 3
0
 def __init__(self):
     super(Giedo, self).__init__(settings.GIEDO_SOCKET)
     self.l = logging.getLogger('giedo')
     self.last_sync_ts = 0
     self.daan, self.cilia = None, None
     try:
         self.daan = WhimClient(settings.DAAN_SOCKET)
     except:
         self.l.exception("Couldn't connect to daan")
     try:
         self.cilia = WhimClient(settings.CILIA_SOCKET)
     except:
         self.l.exception("Couldn't connect to cilia")
     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.openvpn_lock = threading.Lock()
     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),
               ('wolk', self.cilia, self._gen_wolk),
               ('quassel', self.daan, self._gen_quassel))
     self.push_changes_event.set()
Exemplo n.º 4
0
 def main(self):
     self.parse_args()
     if self.args.verbosity >= 1:
         sarah.coloredLogging.basicConfig(
             level=logging.DEBUG, formatter=mirte.main.MirteFormatter())
     subprocess.call(['amixer', 'set', 'Master', 'unmute'],
                     stdout=subprocess.PIPE)
     subprocess.call(['amixer', 'set', 'Master', '50%'],
                     stdout=subprocess.PIPE)
     subprocess.call(['amixer', 'set', 'PCM', 'unmute'],
                     stdout=subprocess.PIPE)
     subprocess.call(['amixer', 'set', 'PCM', '0dB'],
                     stdout=subprocess.PIPE)
     self.mirte_manager = m = mirte.get_a_manager()
     mirte.mirteFile.load_mirteFile('pynijmegen', m)
     mirte.mirteFile.load_mirteFile('joyce/comet', m)
     self.joyceClent = m.create_instance('joyceClient', 'cometJoyceClient',
                                         {
                                             'host': self.args.host,
                                             'port': self.args.port,
                                             'path': self.args.path
                                         })
     self.client = m.create_instance('pynijmegen', 'pynijmegen',
                                     {'joyceClent': 'joyceClient'})
     self.sleep_event.wait()
Exemplo n.º 5
0
 def __init__(self, address, family='unix'):
     self.threadPool = mirte.get_a_manager().get_a('threadPool')
     self.sockets = set()
     self.address = address
     self.family = family
     self.sock_state = dict()
     self.ls = None
     self.packer = msgpack.Packer(use_bin_type=True)
Exemplo n.º 6
0
 def __init__(self, address, family='unix'):
     self.threadPool = mirte.get_a_manager().get_a('threadPool')
     self.sockets = set()
     self.address = address
     self.family = family
     self.sock_state = dict()
     self.ls = None
     self.packer = msgpack.Packer(use_bin_type=True)
Exemplo n.º 7
0
 def __init__(self):
         super(Giedo, self).__init__(settings.GIEDO_SOCKET)
         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.ss_actions = (
                       ('postfix', self.daan, self._gen_postfix),
                       ('mailman', self.daan, self._gen_mailman),
                       ('forum', self.daan, self._gen_forum),
                       ('unix', self.cilia, self._gen_unix),
                       ('wiki', self.daan, self._gen_wiki))
Exemplo n.º 8
0
 def __init__(self):
     super(Giedo, self).__init__(settings.GIEDO_SOCKET)
     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.ss_actions = (
         ("postfix", self.daan, self._gen_postfix),
         ("mailman", self.daan, self._gen_mailman),
         ("forum", self.daan, self._gen_forum),
         ("unix", self.cilia, self._gen_unix),
         ("wiki", self.daan, self._gen_wiki),
     )
Exemplo n.º 9
0
 def main(self):
     args = self.parse_args()
     if args.verbosity >= 1:
         sarah.coloredLogging.basicConfig(level=logging.DEBUG,
                                 formatter=mirte.main.MirteFormatter())
     self.mirte_manager = m = mirte.get_a_manager()
     mirte.mirteFile.load_mirteFile('tkb/client', m)
     mirte.mirteFile.load_mirteFile('joyce/comet', m)
     self.joyceClient = m.create_instance('joyceClient', 'cometJoyceClient',
                                         {'host': args.host,
                                          'port': args.port,
                                          'path': args.path})
     self.client = m.create_instance('tkbClient', 'tkbClient',
                                         {'joyceClient': 'joyceClient'})
     args.func(args)
     m.stop()
Exemplo n.º 10
0
 def __init__(self):
     super(Giedo, self).__init__(settings.GIEDO_SOCKET)
     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),
               ('mailman', self.daan, self._gen_mailman),
               ('forum', self.daan, self._gen_forum),
               ('unix', self.cilia, self._gen_unix),
               ('wiki', self.daan, self._gen_wiki))
     self.push_changes_event.set()
Exemplo n.º 11
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()
Exemplo n.º 12
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))
Exemplo n.º 13
0
 def main(self):
     self.parse_args()
     if self.args.verbosity >= 1:
         sarah.coloredLogging.basicConfig(level=logging.DEBUG,
                                 formatter=mirte.main.MirteFormatter())
     subprocess.call(['amixer', 'set', 'Master', 'unmute'],
                         stdout=subprocess.PIPE)
     subprocess.call(['amixer', 'set', 'Master', '50%'],
                         stdout=subprocess.PIPE)
     subprocess.call(['amixer', 'set', 'PCM', 'unmute'],
                         stdout=subprocess.PIPE)
     subprocess.call(['amixer', 'set', 'PCM', '0dB'],
                         stdout=subprocess.PIPE)
     self.mirte_manager = m = mirte.get_a_manager()
     mirte.mirteFile.load_mirteFile('pynijmegen', m)
     mirte.mirteFile.load_mirteFile('joyce/comet', m)
     self.joyceClent = m.create_instance('joyceClient', 'cometJoyceClient',
                                     {'host': self.args.host,
                                      'port': self.args.port,
                                      'path': self.args.path})
     self.client = m.create_instance('pynijmegen', 'pynijmegen',
                                     {'joyceClent': 'joyceClient'})
     self.sleep_event.wait()