<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def listSites(self, block_name="", site_name=""):
 """ Returns sites. """

        try:
            conn = self.dbi.connection()
            if block_name:
                result = self.blksitelist.execute(conn, block_name)
            else:
                result = self.sitelist.execute(conn, site_name)
            return result
        finally:
            if conn:
                conn.close()