bversion/backup/s3_interface.py
def wipe_all(conn):
    """ wipe everything on the remote for testing purposes """

    truncated = True
    key_marker = None
    while truncated:
        if key_marker is None:
            version_list = conn['client'].list_object_versions(Bucket=conn['bucket'])
        else:
            version_list = conn['client'].list_object_versions(Bucket=conn['bucket'],KeyMarker=key_marker)

        try:
            versions = version_list['Versions']
            objects = [{'VersionId':v['VersionId'],'Key': v['Key']} for v in versions]
            conn['client'].delete_objects(Bucket=conn['bucket'],Delete={'Objects':objects})
        except: pass

        try:
            delete_markers = version_list['DeleteMarkers']
            objects = [{'VersionId':d['VersionId'],'Key': d['Key']} for d in delete_markers]
            conn['client'].delete_objects(Bucket=conn['bucket'],Delete={'Objects':objects})
        except: pass

        truncated  = version_list['IsTruncated']
        #if 'NextKeyMarker' in version_list:
        #    Key_marker = version_list['NextKeyMarker']
 wipe everything on the remote for testing purposes 
wipe everything on the remote for testing purposes
wipe everything on the remote for testing purposes
def wipe_all(conn):
    truncated = True
    key_marker = None
    while truncated:
        if key_marker is None:
            version_list = conn['client'].list_object_versions(Bucket=conn['bucket'])
        else:
            version_list = conn['client'].list_object_versions(Bucket=conn['bucket'],KeyMarker=key_marker)
        try:
            versions = version_list['Versions']
            objects = [{'VersionId':v['VersionId'],'Key': v['Key']} for v in versions]
            conn['client'].delete_objects(Bucket=conn['bucket'],Delete={'Objects':objects})
        except: pass
        try:
            delete_markers = version_list['DeleteMarkers']
            objects = [{'VersionId':d['VersionId'],'Key': d['Key']} for d in delete_markers]
            conn['client'].delete_objects(Bucket=conn['bucket'],Delete={'Objects':objects})
        except: pass
        truncated  = version_list['IsTruncated']
def wipe_all ( conn ) : truncated = True key_marker = None while truncated : if key_marker is None : version_list = conn [ 'client' ] . list_object_versions ( Bucket = conn [ 'bucket' ] ) else : version_list = conn [ 'client' ] . list_object_versions ( Bucket = conn [ 'bucket' ] , KeyMarker = key_marker ) try : versions = version_list [ 'Versions' ] objects = [ { 'VersionId' : v [ 'VersionId' ] , 'Key' : v [ 'Key' ] } for v in versions ] conn [ 'client' ] . delete_objects ( Bucket = conn [ 'bucket' ] , Delete = { 'Objects' : objects } ) except : pass try : delete_markers = version_list [ 'DeleteMarkers' ] objects = [ { 'VersionId' : d [ 'VersionId' ] , 'Key' : d [ 'Key' ] } for d in delete_markers ] conn [ 'client' ] . delete_objects ( Bucket = conn [ 'bucket' ] , Delete = { 'Objects' : objects } ) except : pass truncated = version_list [ 'IsTruncated' ]
wipe everything on the remote for testing purposes
wipe everything on the remote for testing purposes
""" wipe everything on the remote for testing purposes """ #if 'NextKeyMarker' in version_list: #    Key_marker = version_list['NextKeyMarker']
conn