def getDataFromURL(url):
    '''Returns data from url as string. We use the existing
    getResourceIfChangedAtomically function so any custom
    authentication/authorization headers are reused'''
    urldata = os.path.join(munkicommon.tmpdir(), 'urldata')
    if os.path.exists(urldata):
        try:
            os.unlink(urldata)
        except (IOError, OSError), err:
            munkicommon.display_warning('Error in getDataFromURL: %s', err)
    dummy_result = getResourceIfChangedAtomically(url, urldata)
    try:
        fdesc = open(urldata)
        data = fdesc.read()
        fdesc.close()
        os.unlink(urldata)
        return data
    except (IOError, __HOLE__), err:
        munkicommon.display_warning('Error in getDataFromURL: %s', err)
        return ''
dataset/ETHPy150Open munki/munki/code/client/munkilib/updatecheck.py/getDataFromURL