'Close the connection and reset'

def closeDbConnection(self, hostKey, connection):

    self.serverHostDefsLock.acquire()
    try:
        if (hostKey in self.serverHostDefs):
            if ('availableCmds' in self.serverHostDefs[hostKey]):
                del self.serverHostDefs[hostKey]['availableCmds']
    except:
        pass
    finally:
        self.serverHostDefsLock.release()
    if (connection is not None):
        try:
            connection.disconnect()
        except:
            pass
    return None
