Re: [netmod] Does the YANG "status" statement inherit from its parent node?

Ladislav Lhotka <lhotka@nic.cz> Wed, 21 December 2016 09:16 UTC

Return-Path: <lhotka@nic.cz>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C657C129489 for <netmod@ietfa.amsl.com>; Wed, 21 Dec 2016 01:16:52 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xguLjg0cJJWD for <netmod@ietfa.amsl.com>; Wed, 21 Dec 2016 01:16:50 -0800 (PST)
Received: from trail.lhotka.name (trail.lhotka.name [77.48.224.143]) by ietfa.amsl.com (Postfix) with ESMTP id F3101129458 for <netmod@ietf.org>; Wed, 21 Dec 2016 01:16:49 -0800 (PST)
Received: from localhost (unknown [195.113.220.110]) by trail.lhotka.name (Postfix) with ESMTPSA id 308901CC00A5; Wed, 21 Dec 2016 10:16:44 +0100 (CET)
From: Ladislav Lhotka <lhotka@nic.cz>
To: Martin Bjorklund <mbj@tail-f.com>, rwilton@cisco.com
In-Reply-To: <20161220.210335.1870203216124697421.mbj@tail-f.com>
References: <1db67b1d-36ef-5cc6-425f-7e22de7e80ae@cisco.com> <20161220.210335.1870203216124697421.mbj@tail-f.com>
Date: Wed, 21 Dec 2016 10:16:43 +0100
Message-ID: <m2wpety744.fsf@birdie.labs.nic.cz>
MIME-Version: 1.0
Content-Type: text/plain
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/Ds7D1y3POFUzqqEZhLSYkKdXgdc>
Cc: netmod@ietf.org
Subject: Re: [netmod] Does the YANG "status" statement inherit from its parent node?
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 21 Dec 2016 09:16:53 -0000

Martin Bjorklund <mbj@tail-f.com> writes:

> Robert Wilton <rwilton@cisco.com> wrote:
>> Hi,
>> 
>> The definition of "status" in RFC 7950 in section 7.21.2 (full text
>> below), states:
>> 
>> If no status is specified, the default is "current".
>> 
>> From my interpretation of the text in the draft, this implies that the
>> status of the "new" child leaf in the following example is "current",
>> and that this example is allowed!
>> 
>> My questions are:
>>  - Is my interpretation of the current text correct?
>
> Yes.
>
>>  - Is this actually the best behaviour, or should it inherit like the
>>    config statement?
>
> I think the idea was that if the status != current, it is better for
> the reader if it is explicitly stated.
>
>>  Should I raise an errata for this?
>
> No.
>
> However, we could have said that a current node under a deprecated
> node (etc) in the same module is an error, in order to force people
> (through the useage of YANG validators) to detect and fix this.

Since "current" is the default, correctly deprecating a subtree would
mean to explicitly add the "status" statement to every single node in
the subtree.

I think that "obsolete" should apply to the whole subtree, no matter
what status descendants have, and "deprecated" should apply to the whole
subtree except for parts that are obsolete.

Lada

>
>
> /martin
>
>
>
>> 
>> container old {
>>   status deprecated;
>>   leaf new {
>>     description "what status do I have?";
>>   }
>> }
>> 
>> Thanks,
>> Rob
>> 
>> 
>> Full 7.21.2 text from 7950:
>> 
>> 7.21.2.  The "status" Statement
>> 
>>    The "status" statement takes as an argument one of the strings
>>    "current", "deprecated", or "obsolete".
>> 
>>    o  "current" means that the definition is current and valid.
>> 
>>    o  "deprecated" indicates an obsolete definition, but it permits
>>       new/continued implementation in order to foster interoperability
>>       with older/existing implementations.
>> 
>>    o  "obsolete" means that the definition is obsolete and SHOULD NOT be
>>       implemented and/or can be removed from implementations.
>> 
>>    If no status is specified, the default is "current".
>> 
>>    If a definition is "current", it MUST NOT reference a "deprecated" or
>>    "obsolete" definition within the same module.
>> 
>>    If a definition is "deprecated", it MUST NOT reference an "obsolete"
>>    definition within the same module.
>> 
>>    For example, the following is illegal:
>> 
>>      typedef my-type {
>>        status deprecated;
>>        type int32;
>>      }
>> 
>>      leaf my-leaf {
>>        status current;
>>        type my-type; // illegal, since my-type is deprecated
>>      }
>> 
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod

-- 
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67