volume.py 文件源码

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

项目:alfred-ec2 作者: SoMuchToGrok 项目源码 文件源码
def get_snapshots(self):
        """
        Returns a list of all completed snapshots for this volume ID.
        """
        ec2 = self.get_ec2_connection()
        rs = ec2.get_all_snapshots()
        all_vols = [self.volume_id] + self.past_volume_ids
        snaps = []
        for snapshot in rs:
            if snapshot.volume_id in all_vols:
                if snapshot.progress == '100%':
                    snapshot.date = boto.utils.parse_ts(snapshot.start_time)
                    snapshot.keep = True
                    snaps.append(snapshot)
        snaps.sort(cmp=lambda x, y: cmp(x.date, y.date))
        return snaps
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号