def loadEntitlement(dirName, serverName):
    if not dirName:
        # XXX
        # this is a hack for the repository server which doesn't support
        # entitlements, but needs to stop cross talking anyway
        return None

    fullPath = os.path.join(dirName, serverName)

    if not os.access(fullPath, os.R_OK):
        return None

    if os.access(fullPath, os.X_OK):
        return loadEntitlementFromProgram(fullPath,
                                          '<executable %s>' % fullPath)
    elif os.access(fullPath, os.R_OK):
        return loadEntitlementFromString(open(fullPath).read(), fullPath)
    else:
        return None
dataset/ETHPy150Open sassoftware/conary/conary/conarycfg.py/loadEntitlement/original