dao.py 文件源码

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

项目:forseti-security 作者: GoogleCloudPlatform 项目源码 文件源码
def _get_snapshot_table(self, resource_name, timestamp):
        """Returns a snapshot table name.

        Args:
            resource_name (str): String of the resource name.
            timestamp (str): String of timestamp, formatted as YYYYMMDDTHHMMSSZ.

        Returns:
            str: String of the created snapshot table.
        """
        try:
            snapshot_table_name = self.create_snapshot_table(
                resource_name, timestamp)
        except OperationalError:
            # TODO: find a better way to handle this. I want this method
            # to be resilient when the table has already been created
            # so that it can support inserting new data. This will catch
            # a sql 'table already exist' error and alter the flow.
            snapshot_table_name = self._create_snapshot_table_name(
                resource_name, timestamp)
        return snapshot_table_name
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号