'Attempt to close a file descriptor.'

def close_file_descriptor(self, fd):

    start_timer = time.time()
    error = ''
    while True:
        try:
            fd.close()
            break
        except IOError as e:
            log.debug(('Error    closing    file    descriptor:    %s' % str(e)))
            time.sleep(0.5)
            current_wait_time = (time.time() - start_timer)
            if (current_wait_time >= 600):
                error = ('Error    closing    file    descriptor:    %s' % str(e))
                break
    return error
