def getId(self, theId, justPresent = True):
        cu = self.db.cursor()

        if justPresent:
            pres = "AND isPresent=1"
        else:
            pres = ""

        cu.execute("SELECT troveName, versionId, flavorId, isPresent "
                   "FROM Instances WHERE instanceId=? %s" % pres, theId)
        try:
            return cu.next()
        except __HOLE__:
            raise KeyError, theId
dataset/ETHPy150Open sassoftware/conary/conary/local/sqldb.py/DBInstanceTable.getId