# Deviating a augment statement

**URL:** <https://dmap-community.ductus.global/t/deviating-a-augment-statement/3035>\
**Category:** YANG\
**Created:** [April 28, 2020, 1:28pm UTC](https://dmap-community.ductus.global/t/deviating-a-augment-statement/3035 "2020-04-28T13:28:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nandakm](https://avatars.discourse-cdn.com/v4/letter/n/c0e974/32.png) [@nandakm](https://dmap-community.ductus.global/u/nandakm)\
**Post date:** [April 28, 2020, 1:28pm UTC](https://dmap-community.ductus.global/t/deviating-a-augment-statement/3035/1 "2020-04-28T13:28:41Z")

</div>

Hello,  
We have a situation ,  
where there is a augment statement , that needs to be suppressed when a certain deviation is present .  
Is there a way to do that ?

we have something like

deviate “path\_x/path\_y/path\_z/leaf”  
{  
deviate not-supported;  
}

and then there is augment which uses that path somewhere .  
augment “path\_x/path\_y”  
{  
uses some\_foo;  
}

Should the augmentation controlled by Makfile or it can be controled by Deviations too ?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![mvf](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/mvf/32/182_2.png) [@mvf](https://dmap-community.ductus.global/u/mvf)\
**Post date:** [April 29, 2020, 12:24pm UTC](https://dmap-community.ductus.global/t/deviating-a-augment-statement/3035/2 "2020-04-29T12:24:43Z")

</div>

No, you cannot deviate an augment statement, just like you cannot augment an augment statement - both for `deviate` as well as for `augment` the argument has to identify a schema node.

If the module with the augment statement is owned by you, you have a number of options:

- Remove the augment in compile time, as you write. But you should not do that if the module has already been published or is going to be published or generally used elsewhere with the augment.
- Add `if-feature` statement to augment; I think it’s a bit more ok-ish than the previous option in case of already published module

If you do not own the module, you should not touch it; as far as I can tell, in that case you can only deviate all nodes within the `some_foo` grouping that appear under `path_y`.

---

<div class="post-metadata">

**Author:** ![nabil](https://avatars.discourse-cdn.com/v4/letter/n/e79b87/32.png) [@nabil](https://dmap-community.ductus.global/u/nabil)\
**Post date:** [April 29, 2020, 9:28pm UTC](https://dmap-community.ductus.global/t/deviating-a-augment-statement/3035/3 "2020-04-29T21:28:49Z")

</div>

As Martin mentioned, I also think if-feature is much better for this scenario, but for both the deviation and the augment. If instead of deviating you use the if-feature, it will be better from a conformance perspective.

You can also add a when statement for the augment, with a condition that some leaf config is not present for example.
