'Read credential file and return token information.
Mocked in libcloud.test.common.google.GoogleTestCase.
:return:  Token information dictionary, or None
:rtype:   ``dict`` or ``None``'

def _get_token_from_file(self):

    token = None
    filename = os.path.realpath(os.path.expanduser(self.credential_file))
    try:
        with open(filename, 'r') as f:
            data = f.read()
        token = json.loads(data)
    except (IOError, ValueError):
        e = sys.exc_info()[1]
        LOG.info('Failed    to    read    cached    auth    token    from    file    "%s":    %s', filename, str(e))
    return token
