deploy.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:ardy 作者: avara1986 项目源码 文件源码
def remote_update_alias(self, **kwargs):
        conf = kwargs
        try:
            logger.info("Update alias {} for function {}"
                        " with version {}".format(conf["Name"],
                                                  conf["FunctionName"],
                                                  conf["FunctionVersion"]))
            response = self.awslambda.update_alias(**conf)
        except ClientError as e:
            if e.response['Error']['Code'] == "ResourceNotFoundException":
                logger.info("Alias {} not exist for function {}. "
                            "Creating new one with version {}".format(conf["Name"],
                                                                      conf["FunctionName"],
                                                                      conf["FunctionVersion"]))

                response = self.awslambda.create_alias(**conf)
            else:
                # TODO: handle other errors there
                pass
        return response
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号