Thank you Ladislav, that makes sense to me.

Best regards, Kristian Sällberg
________________________________
From: Ladislav Lhotka <[email protected]>
Sent: Tuesday, October 4, 2022 10:46 AM
To: Kristian Sallberg (krisallb) <[email protected]>; [email protected] 
<[email protected]>
Subject: Re: [netmod] Deviate replace leaf type, from typedef with default value

Hi,

in this case the default value is a property of the type that is being
replaced, so the default is no more effective.

Lada

Dne 04. 10. 22 v 10:34 Kristian Sallberg (krisallb) napsal(a):
> Hello,
>
> I have a question regarding the default value of "/repro:cont/repro:a",
> after deviations have been applied. Since the default value is defined
> in "typedef type_a", and we then replace the type of
> "/repro:cont/repro:a", should the default value of this leaf be removed?
>
> I have not been able to find the answer in the YANG RFCs.
>
> ----
> module repro {
>
>    yang-version 1.1;
>    namespace "rep:ro";
>    prefix repro;
>
>    typedef type_a {
>      type enumeration {
>        enum up {
>          value 1;
>        }
>        enum down {
>          value 2;
>        }
>        enum testing {
>          value 3;
>        }
>      }
>      default "down";
>    }
>
>    typedef type_b {
>      type enumeration {
>        enum up {
>          value 1;
>        }
>        enum down {
>          value 2;
>        }
>        enum testing {
>          value 3;
>        }
>      }
>    }
>
>    container cont {
>      presence "blablablbala";
>      leaf a {
>        type type_a;
>      }
>      leaf b {
>        type type_b;
>        default "down";
>      }
>    }
>
>    deviation "/repro:cont/repro:a" {
>      deviate replace {
>        type enumeration {
>          enum up {
>            value 1;
>          }
>          enum down {
>            value 2;
>          }
>        }
>      }
>    }
>
>    deviation "/repro:cont/repro:b" {
>      deviate replace {
>        type enumeration {
>          enum up {
>            value 1;
>          }
>          enum down {
>            value 2;
>          }
>        }
>      }
>    }
> }
> ----
>
> Best regards, Kristian Sällberg
>
> _______________________________________________
> netmod mailing list
> [email protected]
> https://www.ietf.org/mailman/listinfo/netmod

--
Ladislav Lhotka, CZ.NIC
PGP Key ID: 0xB8F92B08A9F76C67
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to