templates/copy-lambdas.yaml [59:99]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            - '    print(("Collecting data from" + bucket))'
            - "    paginator = client.get_paginator('list_object_versions')"
            - "    result = paginator.paginate(Bucket=bucket)"
            - "    objects = []"
            - "    for page in result:"
            - "        try:"
            - "            for k in page['Versions']:"
            - "                objects.append({'Key':k['Key'],'VersionId': k['VersionId']})"
            - "            try:"
            - "                for k in page['DeleteMarkers']:"
            - "                    version = k['VersionId']"
            - "                    key = k['Key']"
            - "                    objects.append({'Key': key,'VersionId': version})"
            - "            except:"
            - "                pass"
            - '            print("deleting objects")'
            - "            client.delete_objects(Bucket=bucket,     Delete={'Objects':
              objects})"
            - "           # objects = []"
            - "        except:"
            - "            pass"
            - '    print("bucket already empty")'
            - ''
            - ''
            - ''
            - 'def timeout(event, context):'
            - "    logging.error('Execution is about to time out, sending failure
              response to CloudFormation')"
            - "    cfnresponse.send(event, context, cfnresponse.FAILED, {}, None)"
            - ''
            - ''
            - 'def handler(event, context):'
            - "    # make sure we send a failure to CloudFormation if the function
              is going to timeout"
            - "    timer = threading.Timer((context.get_remaining_time_in_millis()
              / 1000.00) - 0.5, timeout, args=[event, context])"
            - "    timer.start()"
            - ''
            - "    print(('Received event: %s' % json.dumps(event)))"
            - "    status = cfnresponse.SUCCESS"
            - "    try:"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



templates/copy-lambdas.yaml [207:247]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            - '    print(("Collecting data from" + bucket))'
            - "    paginator = client.get_paginator('list_object_versions')"
            - "    result = paginator.paginate(Bucket=bucket)"
            - "    objects = []"
            - "    for page in result:"
            - "        try:"
            - "            for k in page['Versions']:"
            - "                objects.append({'Key':k['Key'],'VersionId': k['VersionId']})"
            - "            try:"
            - "                for k in page['DeleteMarkers']:"
            - "                    version = k['VersionId']"
            - "                    key = k['Key']"
            - "                    objects.append({'Key': key,'VersionId': version})"
            - "            except:"
            - "                pass"
            - '            print("deleting objects")'
            - "            client.delete_objects(Bucket=bucket, Delete={'Objects':
              objects})"
            - "           # objects = []"
            - "        except:"
            - "            pass"
            - '    print("bucket already empty")'
            - ''
            - ''
            - ''
            - 'def timeout(event, context):'
            - "    logging.error('Execution is about to time out, sending failure
              response to CloudFormation')"
            - "    cfnresponse.send(event, context, cfnresponse.FAILED, {}, None)"
            - ''
            - ''
            - 'def handler(event, context):'
            - "    # make sure we send a failure to CloudFormation if the function
              is going to timeout"
            - "    timer = threading.Timer((context.get_remaining_time_in_millis()
              / 1000.00) - 0.5, timeout, args=[event, context])"
            - "    timer.start()"
            - ''
            - "    print(('Received event: %s' % json.dumps(event)))"
            - "    status = cfnresponse.SUCCESS"
            - "    try:"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



