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

Andy Bierman <andy@yumaworks.com> Wed, 21 December 2016 16:21 UTC

Return-Path: <andy@yumaworks.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 9B3D5129713 for <netmod@ietfa.amsl.com>; Wed, 21 Dec 2016 08:21:13 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.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 lONxlL2XrWXh for <netmod@ietfa.amsl.com>; Wed, 21 Dec 2016 08:21:12 -0800 (PST)
Received: from mail-qt0-x22c.google.com (mail-qt0-x22c.google.com [IPv6:2607:f8b0:400d:c0d::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 067AB12944E for <netmod@ietf.org>; Wed, 21 Dec 2016 08:21:09 -0800 (PST)
Received: by mail-qt0-x22c.google.com with SMTP id c47so210434086qtc.2 for <netmod@ietf.org>; Wed, 21 Dec 2016 08:21:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=rpY6BtlBOIEEsSlzxTnCCNX07k9q6BlTiRNhSm3l86I=; b=WIilTFA+wftGJWT5MbAcdq+bpzfxuSP853IarAgRSsouq2BuMo+mbQy/xzesgX/a5e gGR4AT+CzgfxKi25Jk7Ylnw43zDnjRbLMCWM6laVaWL+LF7nfzytghAjqRUX+m4N5PJE j1YeQX7evNlWrwcKWrxvdDZZMQe0fn2ej/Erhg4Tem3sHec2EgX/e4t3L6O+eDovd3zG xZqfh3euVDKPfgfDjQvDzVguedr+VFaeg1lqV3W3l929l3dl0+WY6FQPRdAiB1CGp2KH YiG13zwMzr++xZ4j6Lq+tgJZnXdzPX+F1q2ViO1RV+5+HILyxUPKc3f4XnxFrf/oNvja wZ7A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=rpY6BtlBOIEEsSlzxTnCCNX07k9q6BlTiRNhSm3l86I=; b=rrgjrPFD+TUy1ls6+3OtgPtDHWdS8TK7VGtW0gjhssgJ/ZMZEbse1iFSFYH/PG7Wst wAuPRHRLtlKc0a6rOn65Ky467OdK9jGG5j9gfWeD2qbEz1fD/5fdnqIIhIbSIsIifhq5 Oa7WHj/qtdYWtGBu81j3xOvHeOTmz9KjlvkDHTCQ0PjHZeg15J9Ka5YGZL+5c7iZt6NR fZgHp2vUmqAfUF3gz1DA8J4F5A+6yqtZoF50fOvcUBxS8YDcov8i8pwz5n4sl2xintzE dcNJ6oJaleV/YNd3DdDccmE/FUDYMz/uZxTqBj99yWT6yEs6YZ3foc+9ZpXiG2CYT/ps h3xA==
X-Gm-Message-State: AIkVDXKLigmBPAP90F1BVLpa/Vf1aC/XmoycnWDpxf9v5O9sUguK9gRl0CuILUzObt9QEVxBzrIZbruKT+z+kQ==
X-Received: by 10.200.40.211 with SMTP id j19mr5971996qtj.72.1482337268787; Wed, 21 Dec 2016 08:21:08 -0800 (PST)
MIME-Version: 1.0
Received: by 10.12.175.113 with HTTP; Wed, 21 Dec 2016 08:21:08 -0800 (PST)
In-Reply-To: <20161221.115438.163227970004322277.mbj@tail-f.com>
References: <m2wpety744.fsf@birdie.labs.nic.cz> <20161221.103208.1910010141581780305.mbj@tail-f.com> <CABCOCHQPRbAbeEg=4-oNzXX6nxJhNbow+ebQy+Qv5NOfngeN7w@mail.gmail.com> <20161221.115438.163227970004322277.mbj@tail-f.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Wed, 21 Dec 2016 08:21:08 -0800
Message-ID: <CABCOCHSW+pCsUjBiKbxq9NKXZo4eAjBvHKtuOS3tNxgqHzuejw@mail.gmail.com>
To: Martin Bjorklund <mbj@tail-f.com>
Content-Type: multipart/alternative; boundary="001a1149e9545808a905442d8a98"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/9Xn-VyW6YAWd6xvSICKXtxfbd5M>
Cc: "netmod@ietf.org" <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 16:21:13 -0000

On Wed, Dec 21, 2016 at 2:54 AM, Martin Bjorklund <mbj@tail-f.com> wrote:

> Andy Bierman <andy@yumaworks.com> wrote:
> > On Wed, Dec 21, 2016 at 1:32 AM, Martin Bjorklund <mbj@tail-f.com>
> wrote:
> >
> > > Ladislav Lhotka <lhotka@nic.cz> wrote:
> > > > 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.
> > >
> > > Yes.
> > >
> >
> > Please explain what it means for YANG to say
> > "The parent node is deprecated and going away but the child nodes are
> not.
> > They are current and are staying around."  This does not seem to make any
> > sense.
>
> Agreed.  But this should be invalid also if the status statements are
> given explicitly:
>

IMO the default should be inherit from parent, like the config-stmt.
It clutters the YANG module to add a status-stmt to every descendant node.
The status also applies to augment.  If /foo is deprecated than any
external augments
that adds nodes under /foo is also deprecated.  (Most obvious when you
change deprecated
to obsolete).



>
>   container a {
>     status deprecated;
>     container b {
>       status current;
>     }
>   }
>
>

I tested pyang with explicit statements and no warnings are given:


  container A {
    status deprecated;
    leaf AA {
      type string;
      status current;
    }
  }

  container B {
    status obsolete;
    leaf BB {
      type string;
      status current;
    }
  }


> Clearly an obsolete node removes all access of its descendant nodes.
> > There is no way to access /foo/child if /foo has been removed from the
> > server.
>
> Yes.
>
> > So how do I access a deprecated /foo/child node inside an obsolete /foo
> > container?
>
> You can't.
>

So the status-stmt clearly applies to descendant-or-self.



>
>
> /martin
>


Andy