'Determine whether the current state of an application is divergent from
the configuration for that application in a way that merits an
application restart right now.
Certain differences are not considered divergences:
- Certain volume differences.  See ``_restart_for_volume_change``.
:param NodeState node_state: The known local state of this node.
:param Application state: The current state of the application.
:param Application configuration: The desired configuration for the
application.
:return: If the state differs from the configuration in a way which
needs to be corrected by the convergence agent (for example,
different network ports should be exposed), ``True``.  If it does
not differ or only differs in the allowed ways mentioned above,
``False``.'

def _restart_for_application_change(self, node_state, state, configuration):

    volume_state = state.volume
    volume_configuration = configuration.volume
    restart_state = state.restart_policy
    comparable_state = state.set(volume=None, restart_policy=RestartNever())
    comparable_configuration = configuration.set(volume=None, restart_policy=RestartNever())
    return ((comparable_state != comparable_configuration) or (not isinstance(restart_state, RestartNever)) or self._restart_for_volume_change(node_state, volume_state, volume_configuration))
