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

Robert Wilton <rwilton@cisco.com> Tue, 20 December 2016 17:09 UTC

Return-Path: <rwilton@cisco.com>
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 E3E68129BB5 for <netmod@ietfa.amsl.com>; Tue, 20 Dec 2016 09:09:21 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -17.621
X-Spam-Level:
X-Spam-Status: No, score=-17.621 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-3.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.com
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 ll9mOoTmxfYy for <netmod@ietfa.amsl.com>; Tue, 20 Dec 2016 09:09:20 -0800 (PST)
Received: from aer-iport-2.cisco.com (aer-iport-2.cisco.com [173.38.203.52]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1DE95129BAC for <netmod@ietf.org>; Tue, 20 Dec 2016 09:09:19 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=5570; q=dns/txt; s=iport; t=1482253760; x=1483463360; h=to:from:subject:message-id:date:mime-version; bh=ndAF4ZbFRVfBMgZtwmxZpZ48rN2uRuLtk2yl4hGOISk=; b=FBns7HCgetU+T4JwNXNnThGSg7BLpWYoutfE4OUIvvZrzD8TCQtxofzn 4s2ohoF+cMB1HImCZKY/MdF5jcABkcBGgBudtSXzjmEkqmNkT0HIXYw6d Wd/jv8Ld1xJUZ4x/JZMiJW8NDMJWPugQWqaPCnFQ8V0g8oSNwDiHbrsTG g=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0BRAgCXZFlY/xbLJq1dHAEBBAEBCgEBgnNEAQEBAQGBJ44oc6VQgxaCD4IKiEcUAQIBAQEBAQEBYiiFARFvRAJfAQwIAQEeiEmLQo9VAY12gigvilkBAQgCASWGNoF9iiCCXQWUboYCgUuIGYdQih6BMoR9ijWHdB83MVIVDoYGPokmAQEB
X-IronPort-AV: E=Sophos;i="5.33,379,1477958400"; d="scan'208,217";a="648041346"
Received: from aer-iport-nat.cisco.com (HELO aer-core-1.cisco.com) ([173.38.203.22]) by aer-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2016 17:09:16 +0000
Received: from [10.63.23.74] (dhcp-ensft1-uk-vla370-10-63-23-74.cisco.com [10.63.23.74]) by aer-core-1.cisco.com (8.14.5/8.14.5) with ESMTP id uBKH9Fvv020476; Tue, 20 Dec 2016 17:09:16 GMT
To: "netmod@ietf.org" <netmod@ietf.org>, Martin Bjorklund <mbj@tail-f.com>
From: Robert Wilton <rwilton@cisco.com>
Message-ID: <1db67b1d-36ef-5cc6-425f-7e22de7e80ae@cisco.com>
Date: Tue, 20 Dec 2016 17:09:15 +0000
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="------------E15146EDA84011F650227822"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/O65AVNwbbMMAtrriXR_PGnEX_wA>
Subject: [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: Tue, 20 Dec 2016 17:09:22 -0000

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?
  - Is this actually the best behaviour, or should it inherit like the 
config statement?  Should I raise an errata for this?

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
      }