'Quiesce a SnapMirror and wait with retries before aborting.'

def quiesce_then_abort(self, src_backend_name, dest_backend_name, src_flexvol_name, dest_flexvol_name):

    dest_backend_config = config_utils.get_backend_configuration(dest_backend_name)
    dest_vserver = dest_backend_config.netapp_vserver
    dest_client = config_utils.get_client_for_backend(dest_backend_name, vserver_name=dest_vserver)
    source_backend_config = config_utils.get_backend_configuration(src_backend_name)
    src_vserver = source_backend_config.netapp_vserver
    dest_client.quiesce_snapmirror(src_vserver, src_flexvol_name, dest_vserver, dest_flexvol_name)
    retries = (source_backend_config.netapp_snapmirror_quiesce_timeout / QUIESCE_RETRY_INTERVAL)
    @utils.retry(exception.NetAppDriverException, interval=QUIESCE_RETRY_INTERVAL, retries=retries, backoff_rate=1)
    def wait_for_quiesced():
        snapmirror = dest_client.get_snapmirrors(src_vserver, src_flexvol_name, dest_vserver, dest_flexvol_name, desired_attributes=['relationship-status', 'mirror-state'])[0]
        if (snapmirror.get('relationship-status') != 'quiesced'):
            msg = _('SnapMirror    relationship    is    not    quiesced.')
            raise exception.NetAppDriverException(reason=msg)
    try:
        wait_for_quiesced()
    except exception.NetAppDriverException:
        dest_client.abort_snapmirror(src_vserver, src_flexvol_name, dest_vserver, dest_flexvol_name, clear_checkpoint=False)
