def configurationChangeQueueGreenlet(self):
     kz = None
     ac = None
     task = None
     while gConfig.run:
         try:
             if kz is None:
                 kz = kazoo.client.KazooClient(gConfig.zk, logger=self._logger, handler=kazoo.handlers.gevent.SequentialGeventHandler())
                 kz.start()
             if ac is None:
                 accConfig = AccumuloConfiguration(gConfig.ezproperties)
                 ac = EzRPCertStore(host=accConfig.getProxyHost(),
                                    port=accConfig.getProxyPort(),
                                    user=accConfig.getUsername(),
                                    password=accConfig.getPassword(),
                                    privateKey=gConfig.ez_keyfile,
                                    logger=self._logger)
             if task is None:
                 task = gConfig.configurationChangeQueue.get()
             configurer = ezRPConfigNginx.Configurer(kz, ac, self._logger, self._sfh)
             self._logger.info("processing entry in configuration work queue")
             configurer.configure()
             task = None
             gConfig.configurationChangeQueue.task_done()
         except EzRPCertStoreException as ex:
             self._logger.exception('CertStore exception while running configurationChangeQueueGreenlet: %s' % str(ex))
             gConfig.run = False
         except Exception as e:
             self._logger.exception('Exception processing configuration change: %s' % str(e))
             kz = None
             ac = None
     self._logger.info("configurationChangeQueueGreenlet() exiting")
예제 #2
0
    def __init__(self, logger, staticFileHandler):
        self._logger = logger
        self._sfh = staticFileHandler

        self.kz = kazoo.client.KazooClient(
            gConfig.zk,
            logger=self._logger,
            handler=kazoo.handlers.gevent.SequentialGeventHandler())
        self.kz.start()
        self.kz.ensure_path(ezRPKazoo.KZLOCKFILE)
        self.kz.ensure_path(ezRPKazoo.KZCONFLOC)
        self.kz.ensure_path(ezRPKazoo.KZWATCHLOC)
        self.kz.ensure_path(ezRPKazoo.KZSSLCONFLOC)

        accConfig = AccumuloConfiguration(gConfig.ezproperties)
        self.ac = EzRPCertStore(host=accConfig.getProxyHost(),
                                port=accConfig.getProxyPort(),
                                user=accConfig.getUsername(),
                                password=accConfig.getPassword(),
                                privateKey=gConfig.ez_keyfile,
                                logger=self._logger)

        self.lock = gevent.coros.Semaphore()
        self.configurer = ezRPConfigNginx.Configurer(self.kz, self.ac,
                                                     self._logger, self._sfh)
 def __init__(self, logger):
     self._logger = logger
     self._staticPathInLocation = "ezbappstatic"
     self._scHash = dict()     # stores {urlPrefix: hash} of static contents directory
     self._sfsHash = dict()    # stores {urlPrefix: hash} of static contents in Static File Store
     self._curDir = None
     self._buildDir = None
     accConfig = AccumuloConfiguration(gConfig.ezproperties)
     self._sFileStore = EzRPStaticStore(host=accConfig.getProxyHost(),
                                      port=accConfig.getProxyPort(),
                                      user=accConfig.getUsername(),
                                      password=accConfig.getPassword(),
                                      chunk_size=int(gConfig.static_content_chunk_size),
                                      logger=self._logger)
예제 #4
0
 def __init__(self, logger):
     self._logger = logger
     self._staticPathInLocation = "ezbappstatic"
     self._scHash = dict(
     )  # stores {urlPrefix: hash} of static contents directory
     self._sfsHash = dict(
     )  # stores {urlPrefix: hash} of static contents in Static File Store
     self._curDir = None
     self._buildDir = None
     accConfig = AccumuloConfiguration(gConfig.ezproperties)
     self._sFileStore = EzRPStaticStore(
         host=accConfig.getProxyHost(),
         port=accConfig.getProxyPort(),
         user=accConfig.getUsername(),
         password=accConfig.getPassword(),
         chunk_size=int(gConfig.static_content_chunk_size),
         logger=self._logger)
 def configurationChangeQueueGreenlet(self):
     kz = None
     ac = None
     task = None
     while gConfig.run:
         try:
             if kz is None:
                 kz = kazoo.client.KazooClient(
                     gConfig.zk,
                     logger=self._logger,
                     handler=kazoo.handlers.gevent.SequentialGeventHandler(
                     ))
                 kz.start()
             if ac is None:
                 accConfig = AccumuloConfiguration(gConfig.ezproperties)
                 ac = EzRPCertStore(host=accConfig.getProxyHost(),
                                    port=accConfig.getProxyPort(),
                                    user=accConfig.getUsername(),
                                    password=accConfig.getPassword(),
                                    privateKey=gConfig.ez_keyfile,
                                    logger=self._logger)
             if task is None:
                 task = gConfig.configurationChangeQueue.get()
             configurer = ezRPConfigNginx.Configurer(
                 kz, ac, self._logger, self._sfh)
             self._logger.info(
                 "processing entry in configuration work queue")
             configurer.configure()
             task = None
             gConfig.configurationChangeQueue.task_done()
         except EzRPCertStoreException as ex:
             self._logger.exception(
                 'CertStore exception while running configurationChangeQueueGreenlet: %s'
                 % str(ex))
             gConfig.run = False
         except Exception as e:
             self._logger.exception(
                 'Exception processing configuration change: %s' % str(e))
             kz = None
             ac = None
     self._logger.info("configurationChangeQueueGreenlet() exiting")
  def __init__(self, logger, staticFileHandler):
    self._logger = logger
    self._sfh = staticFileHandler

    self.kz = kazoo.client.KazooClient(gConfig.zk, logger=self._logger, handler=kazoo.handlers.gevent.SequentialGeventHandler())
    self.kz.start()
    self.kz.ensure_path(ezRPKazoo.KZLOCKFILE)
    self.kz.ensure_path(ezRPKazoo.KZCONFLOC)
    self.kz.ensure_path(ezRPKazoo.KZWATCHLOC)
    self.kz.ensure_path(ezRPKazoo.KZSSLCONFLOC)

    accConfig = AccumuloConfiguration(gConfig.ezproperties)
    self.ac = EzRPCertStore(host=accConfig.getProxyHost(),
                            port=accConfig.getProxyPort(),
                            user=accConfig.getUsername(),
                            password=accConfig.getPassword(),
                            privateKey=gConfig.ez_keyfile,
                            logger=self._logger)

    self.lock = gevent.coros.Semaphore()
    self.configurer = ezRPConfigNginx.Configurer(self.kz, self.ac, self._logger, self._sfh)