Exemple #1
0
    def handle_request(self):
        """
        Handles the custom resource request to write scheduler global settings to config database
        :return:
        """

        try:
            self._logger.info("Handler {} : Received request {}", self.__class__.__name__, json.dumps(self.event))
            CustomResource.handle_request(self)
        finally:
            self._logger.flush()
Exemple #2
0
    def handle_request(self):
        """
        Handles the custom resource request from cloudformation
        :return: 
        """

        start = datetime.now()
        self._logger.info("Handler {}", self.__class__.__name__)

        self._logger.info("Cloudformation request is {}",
                          safe_json(self._event, indent=2))

        try:
            result = CustomResource.handle_request(self)

            return safe_dict({
                "result":
                result,
                "datetime":
                datetime.now().isoformat(),
                "running-time": (datetime.now() - start).total_seconds()
            })
        except Exception as ex:
            self._logger.error("{} {}", ex, traceback.format_exc())
            raise ex

        finally:
            self._logger.flush()
    def handle_request(self):

        start = datetime.now()
        self._logger.info("Handler {}", self.__class__.__name__)

        self._logger.info("Cloudformation request is {}",
                          safe_json(self._event, indent=2))

        try:
            result = CustomResource.handle_request(self)

            return safe_dict({
                "datetime":
                datetime.now().isoformat(),
                "running-time": (datetime.now() - start).total_seconds(),
                "result":
                result
            })

        finally:
            self._logger.flush()