'Returns a list of files on S3 for an EC2 instance-store (S3-backed)
image. This includes the image\'s manifest and part files.'

def get_image_files(self, image):

    if (not hasattr(image, 'id')):
        image = self.get_image(image)
    if (image.root_device_type == 'ebs'):
        raise exception.AWSError(('Image    %s    is    an    EBS    image.    No    image    files    on    S3.' % image.id))
    bucket = self.get_image_bucket(image)
    bname = re.escape(bucket.name)
    prefix = re.sub(('^%s\\/' % bname), '', image.location)
    prefix = re.sub('\\.manifest\\.xml$', '', prefix)
    files = bucket.list(prefix=prefix)
    manifest_regex = re.compile(('%s\\.manifest\\.xml' % prefix))
    part_regex = re.compile(('%s\\.part\\.(\\d*)' % prefix))
    files = [f for f in files if ((hasattr(f, 'delete') and part_regex.match(f.name)) or manifest_regex.match(f.name))]
    return files
