code: def _finish_disconnection_action(self, action):
          
  
          success = action.data['success']
          conn_key = action.data['id']
  
          if self._get_connection_state(conn_key) != self.Disconnecting:
              self._logger.error("Invalid finish_disconnection action on a connection whose state is not Disconnecting, conn_key=%s", str(conn_key))
              return
  
          # Cannot be None since we checked above to make sure it exists
          data = self._get_connection(conn_key)
          callback = data['callback']
  
          conn_id = data['conn_id']
          int_id = data['int_id']
  
          if success is False:
              reason = action.data['reason']
              if reason is None:
                  reason = "No reason was given"
  
              data['state'] = self.Idle
              data['microstate'] = None
              data['callback'] = None
              callback(conn_id, self.id, False, reason)
          else:
              del self._connections[conn_id]
              del self._int_connections[int_id]
              callback(conn_id, self.id, True, None)
docs: Finish a disconnection attempt
  
          There are two possible outcomes:
          - if we were successful at disconnecting, we transition to disconnected
          - if we failed at disconnecting, we transition back to idle
  
          Args:
              action (ConnectionAction): the action object describing what we are
                  disconnecting from and what the result of the operation was