Пример #1
0
    # with a select hack so we can still exit if someone ask it
    def init_http(self):
        logger.info("[WS_Arbiter] Starting WS arbiter http socket")
        try:
            self.srv = run(host=self.host,
                           port=self.port,
                           server='wsgirefselect')
        except Exception, e:
            logger.error("[WS_Arbiter] Exception : %s" % str(e))
            raise

        logger.info("[WS_Arbiter] Server started")
        # And we link our page

        if self.routes is None or 'push_check_result' in self.routes:
            route('/push_check_result', callback=get_page, method='POST')

        if self.routes is None or 'change_host_var' in self.routes:
            route('/change_host_var',
                  callback=do_change_host_var,
                  method='POST')

        if self.routes is None or 'add_simple_host_dependency' in self.routes:
            route('/add_simple_host_dependency',
                  callback=do_add_simple_host_dependency,
                  method='POST')

        if self.routes is None or 'restart' in self.routes:
            route('/restart', callback=do_restart, method='POST')

        if self.routes is None or 'reload' in self.routes:
Пример #2
0
    # We initialize the HTTP part. It's a simple wsgi backend
    # with a select hack so we can still exit if someone ask it
    def init_http(self):
        logger.info("[WS_Arbiter] Starting WS arbiter http socket")
        try:
            self.srv = run(host=self.host, port=self.port, server='wsgirefselect')
        except Exception, e:
            logger.error("[WS_Arbiter] Exception : %s" % str(e))
            raise

        logger.info("[WS_Arbiter] Server started")
        # And we link our page

        if self.routes is None or 'push_check_result' in self.routes:
            route('/push_check_result', callback=get_page, method='POST')

        if self.routes is None or 'restart' in self.routes:
            route('/restart', callback=do_restart, method='POST')

        if self.routes is None or 'reload' in self.routes:
            route('/reload', callback=do_reload, method='POST')

        if self.routes is None or 'acknowledge' in self.routes:
            route('/acknowledge', callback=do_acknowledge, method='POST')

        if self.routes is None or 'downtime' in self.routes:
            route('/downtime', callback=do_downtime, method='POST')

        if self.routes is None or 'recheck' in self.routes:
            route('/recheck', callback=do_recheck, method='POST')
Пример #3
0
			logger.error("[WS_Nocout] Exception : %s" % str(e))
			raise

	# We initialize the HTTP part. It's a simple wsgi backend
	# with a select hack so we can still exit if someone ask it
	def init_http(self):
		logger.info("[WS_Nocout] Starting WS arbiter http socket")
		try:
			self.srv = run(host=self.host, port=self.port, server='wsgirefselect')
		except Exception, e:
			logger.error("[WS_Nocout] Exception : %s" % str(e))
			raise

		logger.info("[WS_Nocout] Server started")
		# And we link our page
		route('/push_check_result', callback=get_page, method='POST')
		#route('/restart', callback=do_restart, method='POST')
		route('/restart', callback=do_local_restart, method='POST')
		route('/reload', callback=do_reload, method='POST')
		route('/downtime', callback=do_downtime, method='POST')
		route('/recheck', callback=do_recheck, method='POST')
		route('/local_sync', callback=do_local_sync, method='POST')
		route('/live_poll', callback=do_live_poll, method='POST')

	# When you are in "external" mode, that is the main loop of your process
	def main(self):
		global app

		# Change process name (seen in ps or top)
		self.set_proctitle(self.name)
Пример #4
0
            logger.error("[WS_Arbiter] Exception : %s" % str(e))
            raise

    # We initialize the HTTP part. It's a simple wsgi backend
    # with a select hack so we can still exit if someone ask it
    def init_http(self):
        logger.info("[WS_Arbiter] Starting WS arbiter http socket")
        try:
            self.srv = run(host=self.host, port=self.port, server="wsgirefselect")
        except Exception, e:
            logger.error("[WS_Arbiter] Exception : %s" % str(e))
            raise

        logger.info("[WS_Arbiter] Server started")
        # And we link our page
        route("/push_check_result", callback=get_page, method="POST")
        route("/restart", callback=do_restart, method="POST")
        route("/reload", callback=do_reload, method="POST")
        route("/acknowledge", callback=do_acknowledge, method="POST")
        route("/downtime", callback=do_downtime, method="POST")
        route("/recheck", callback=do_recheck, method="POST")

    # When you are in "external" mode, that is the main loop of your process
    def main(self):
        global app

        # Change process name (seen in ps or top)
        self.set_proctitle(self.name)

        # It's an external module, so we need to be sure that we manage
        # the signals
Пример #5
0
 def init_http(self):
     logger.info("[Ws_arbiter] Starting WS arbiter http socket")
     self.srv = run(host=self.host, port=self.port, server='wsgirefselect')
     # And we link our page
     route('/push_check_result', callback=get_page, method='POST')