__init__.py 文件源码

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

项目:repokid 作者: Netflix 项目源码 文件源码
def apply(self, input_list):
        now = datetime.datetime.now(tzlocal())
        try:
            days_delta = self.config['minimum_age']
        except KeyError:
            LOGGER.info('Minimum age not set in config, using default 90 days')
            days_delta = 90

        ago = datetime.timedelta(days=days_delta)

        too_young = []
        for role in input_list:
            if role.create_date > now - ago:
                LOGGER.info('Role {name} created too recently to cleanup. ({date})'.format(
                            name=role.role_name, date=role.create_date))
                too_young.append(role)
        return too_young
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号