# Edit the candidate datastore with mismatch tolerant

**URL:** <https://dmap-community.ductus.global/t/edit-the-candidate-datastore-with-mismatch-tolerant/2937>\
**Category:** NETCONF\
**Created:** [February 20, 2020, 6:02pm UTC](https://dmap-community.ductus.global/t/edit-the-candidate-datastore-with-mismatch-tolerant/2937 "2020-02-20T18:02:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![buddha87](https://avatars.discourse-cdn.com/v4/letter/b/5f8ce5/32.png) [@buddha87](https://dmap-community.ductus.global/u/buddha87)\
**Post date:** [February 20, 2020, 6:02pm UTC](https://dmap-community.ductus.global/t/edit-the-candidate-datastore-with-mismatch-tolerant/2937/1 "2020-02-20T18:02:29Z")

</div>

In some cases, when we try to edit a device candidate datastore, the configurations will have some mismatch with the Yang schema currently loaded in confd.  
This case may happen when we try to copy the configurations from device A to device B, but confd A may have the leaf a while confd B doesn’t have.  
In this case, when we send the edit netconf request, confd B will report error then prevent editing.  
However, for this specific case, the best and most convenience approach is confd can accept editing it can accept (mismatch tolerant, try it best). We know this may be risky in some cases but we will be carefully.

So I wonder whether confd can support this kind of edit Netconf request with mismatch tolerant ?  
The result should be candidate datastore is edited with all the configurations matched with schema.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![per](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@per](https://dmap-community.ductus.global/u/per)\
**Post date:** [February 20, 2020, 7:56pm UTC](https://dmap-community.ductus.global/t/edit-the-candidate-datastore-with-mismatch-tolerant/2937/2 "2020-02-20T19:56:49Z")

</div>

> [@buddha87](#):
>
> So I wonder whether confd can support this kind of edit Netconf request with mismatch tolerant ?

See [RFC 6241 - Network Configuration Protocol (NETCONF)](https://tools.ietf.org/html/rfc6241#section-7.2) -

```auto
      test-option: The <test-option> element MAY be specified only if
         the device advertises the :validate:1.1 capability
         (Section 8.6).

         The <test-option> element has one of the following values:

         test-then-set: Perform a validation test before attempting to
            set. If validation errors occur, do not perform the
            <edit-config> operation. This is the default test-option.

         set: Perform a set without a validation test first.

         test-only: Perform only the validation test, without
            attempting to set.

```

I.e. if you want to edit the candidate such that the result does not satisfy the constraints specified in the YANG module (which is perfectly reasonable per se), you need to pass `<test-option>set</test-option>`. Note though that `<commit>` will reject such a configuration - there is no way to write an invalid configuration to `running`.

---

<div class="post-metadata">

**Author:** ![buddha87](https://avatars.discourse-cdn.com/v4/letter/b/5f8ce5/32.png) [@buddha87](https://dmap-community.ductus.global/u/buddha87)\
**Post date:** [February 26, 2020, 4:22pm UTC](https://dmap-community.ductus.global/t/edit-the-candidate-datastore-with-mismatch-tolerant/2937/3 "2020-02-26T16:22:55Z")

</div>

Thanks for the inforamtion!
