marcy-terui/lamvery

return value of lambda function not printed to screen?

erichennings opened this issue · 0 comments

I think I may have misunderstood something, but I was surprised that the return value of a lamda function is not printed to screen after it is invoked, only the log message.

i.e. in actions.invoke I was expecting something along these line:

    def action(self):
        qualifier = self._alias
        client = self.get_lambda_client()

        if self._version is not None:
            qualifier = self._version

        ret = client.invoke(
            name=self._config.get_function_name(),
            qualifier=qualifier,
            payload=self._json)

        if ret.get('FunctionError') is None:


            print ret.get('Payload').read()   # <--------------------------- Line Added

            cprint(base64.b64decode(ret.get('LogResult')), 'green')
        else:
            self._logger.error('{} error occurred'.format(ret.get('FunctionError')))
            cprint(base64.b64decode(ret.get('LogResult')), 'red')

Would something like that be desired behavior?