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

Andy Bierman <andy@yumaworks.com> Thu, 22 December 2016 20:39 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 36764129585 for <netmod@ietfa.amsl.com>; Thu, 22 Dec 2016 12:39:24 -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 4SWVUOZWAt3Z for <netmod@ietfa.amsl.com>; Thu, 22 Dec 2016 12:39:22 -0800 (PST)
Received: from mail-qk0-x22b.google.com (mail-qk0-x22b.google.com [IPv6:2607:f8b0:400d:c09::22b]) (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 EFD9512957A for <netmod@ietf.org>; Thu, 22 Dec 2016 12:39:21 -0800 (PST)
Received: by mail-qk0-x22b.google.com with SMTP id u25so115074808qki.2 for <netmod@ietf.org>; Thu, 22 Dec 2016 12:39:21 -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=c/smJo++pandqcoMV3FS8s5mxiACSo1bAqM9TkfoCyM=; b=XTKO0f5bNRJL8BQ7bR07jqUeKla8UvVSJ6QUCfUC6WNZStzeqfFldqyIAY+WLwlg1y TdnMTO0e6K9GZJli9mdabMRFR4hk7hYQ0Tl06VzFKcIv7YKwcWKzSIb/JyVvn7ass2u0 ZjfayoMjuWvgDSHZzJpdzABhl1rpKOavZJM8yTwUCEKWFCEi6DkhTiGficpCGsb5jrWl mOixHYv84eE//1zFryAOpAYKbsS0YKOn3ssAPmNfIZ2XhAFsNdVjcwXWle4hdMf1YMPq LCkKLNtYqU1mZ+67kmHVrH7xODVai8dIipPUm8BGnOUgtgifhdUAfnydwcZuWieCYmou 3aqw==
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=c/smJo++pandqcoMV3FS8s5mxiACSo1bAqM9TkfoCyM=; b=co1sItNtQmiDwOlx+05g8rNGm7NqzcunbfIfv0T5NKeAtdSfunzrh3rl9///o3ft38 yYXQD8t4ZNiAgYuc13YS4FtPZS4uO5ENa10Rs53hnlVpN61jWy0ckmeAKINce6OVm1GS PPgdgZV1m3a4GXgA1p5NFeK4goha6PWqMm2iX74cXdTkDfM3LBdgHns+QLCevfiHoGbL mHLomJRRNTNRun85ybrbI24FmdUykBIdEQjZ21I9G0VJNXwVKGbkSsuLWh9qAy8ROKhD Hg/UPA8MtiOHmtqrtwNoA1ANndev6ir/3ikREdZW9jR85X0TGB7rqD9crl+xXbk6MrnF 7gFQ==
X-Gm-Message-State: AIkVDXI/UmX/kLlGZhRdP2YQ+11+XXq81ZEaK5u9+1MaW9pBs1kGsDOve1z/jV5qlmlsRIlETZ3Y0FytncJnIw==
X-Received: by 10.55.76.197 with SMTP id z188mr11705094qka.184.1482439161028; Thu, 22 Dec 2016 12:39:21 -0800 (PST)
MIME-Version: 1.0
Received: by 10.12.175.113 with HTTP; Thu, 22 Dec 2016 12:39:20 -0800 (PST)
In-Reply-To: <5ab58f5f-25d4-5cf9-f46c-c144da8e5597@cisco.com>
References: <8ac64b13-469c-31fe-9d2b-ad0487204d69@cisco.com> <20161222.112242.1766522035191268644.mbj@tail-f.com> <8d2df0d5-b662-23a6-8339-1acf5086ae62@cisco.com> <20161222.114940.1495001277375813904.mbj@tail-f.com> <5ab58f5f-25d4-5cf9-f46c-c144da8e5597@cisco.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Thu, 22 Dec 2016 12:39:20 -0800
Message-ID: <CABCOCHRUEJowikADitG0PVu1mch4UP_SvsR1Md4zFXNWYebM4w@mail.gmail.com>
To: Robert Wilton <rwilton@cisco.com>
Content-Type: multipart/alternative; boundary="001a114a80629858bb0544454305"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/rRvvXG07XGZ8WWFrTg3-lciyp40>
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: Thu, 22 Dec 2016 20:39:24 -0000

On Thu, Dec 22, 2016 at 3:24 AM, Robert Wilton <rwilton@cisco.com> wrote:

>
>
> On 22/12/2016 10:49, Martin Bjorklund wrote:
>
>> Robert Wilton <rwilton@cisco.com> wrote:
>>
>>>
>>> On 22/12/2016 10:22, Martin Bjorklund wrote:
>>>
>>>> Robert Wilton <rwilton@cisco.com> wrote:
>>>>
>>>>> On 22/12/2016 10:00, Andy Bierman wrote:
>>>>>
>>>>>> On Wed, Dec 21, 2016 at 11:49 PM, Ladislav Lhotka <lhotka@nic.cz
>>>>>> <mailto:lhotka@nic.cz>> wrote:
>>>>>>
>>>>>>
>>>>>>       > On 22 Dec 2016, at 07:22, Randy Presuhn
>>>>>>       <randy_presuhn@alumni.stanford.edu
>>>>>>       <mailto:randy_presuhn@alumni.stanford.edu>> wrote:
>>>>>>       >
>>>>>>       > Hi -
>>>>>>       >
>>>>>>       > On 12/21/2016 3:55 PM, Andy Bierman wrote:
>>>>>>       >>
>>>>>>       >>
>>>>>>       >> On Wed, Dec 21, 2016 at 3:41 PM, Juergen Schoenwaelder
>>>>>>       >> <j.schoenwaelder@jacobs-university.de
>>>>>>       <mailto:j.schoenwaelder@jacobs-university.de>
>>>>>>       >> <mailto:j.schoenwaelder@jacobs-university.de
>>>>>>       <mailto:j.schoenwaelder@jacobs-university.de>>> wrote:
>>>>>>       > ...
>>>>>>       >>    Perhaps I am blinded by the way @deprecate or
>>>>>> __attribute__
>>>>>>       >>    ((deprecated)) or [[deprecated]] work in various
>>>>>> programming
>>>>>>       >>    languages. All these annotations do not deprecate my code,
>>>>>>       they just
>>>>>>       >>    cause the generation of warnings so that I get aware of
>>>>>> the
>>>>>>       issue and
>>>>>>       >>    can do my homework.
>>>>>>       >>
>>>>>>       >>
>>>>>>       >> There are no protocols that let you manage orphaned data
>>>>>> nodes
>>>>>>       >> without any parent.  No way to represent it in XML or JSON
>>>>>> either.
>>>>>>       >> No way to specify a RESTCONF target resource that leaves out
>>>>>>       >> some intermediate data nodes.
>>>>>>       >
>>>>>>       > Deprecating (or obsoleting) a definition does not orphan data
>>>>>> nodes.
>>>>>>       > Perhaps I'm blinded by the way SNMP works, but it seems to me
>>>>>> that
>>>>>>       > a robust client will need to be able to process data
>>>>>> corresponding
>>>>>>       > to deprecated (or obsolete) definitions.  Likewise, developers
>>>>>>       > of server-side software may find themselves in situations
>>>>>> where
>>>>>>       > supporting obsolete definitions is a commercial necessity.
>>>>>> Things
>>>>>>       > certainly played out that way in the SNMP world.  I agree with
>>>>>>       Juergen
>>>>>>       > that tool-generated warnings seem to be the correct way to go.
>>>>>>
>>>>>>       I agree that making a node deprecated or obsolete doesn't mean
>>>>>>       that its descendants are orphaned, it just means they cannot be
>>>>>>       current, and then "current" shouldn't be the default status for
>>>>>>       them - also because the descendants may come from other modules
>>>>>>       (via groupings and augments) that cannot be changed.
>>>>>>
>>>>>>       Even if the default status is inherited, tools can still
>>>>>> generate
>>>>>>       warnings. A data modeller can decide whether and where it makes
>>>>>>       sense to have the "status" statement explicitly, but isn't
>>>>>> forced
>>>>>>       to do it everywhere.
>>>>>>
>>>>>>
>>>>>>
>>>>>> NETCONF and RESTCONF have no mechanisms for accessing data other than
>>>>>> top-down from the top-level YANG data node to the target node.
>>>>>> Removing an ancestor node from the server implementation effectively
>>>>>> removes
>>>>>> the entire subtree from the implementation.  (The value of the YANG
>>>>>> status-stmt
>>>>>> of the descendant nodes has nothing to do with it)
>>>>>>
>>>>> I agree that this certainly seems to be the case if a node is marked
>>>>> as obsolete.  It seems that it implicitly forces all child nodes to be
>>>>> obsolete as well regardless of which module they were defined in.
>>>>>
>>>> No I don't think this is correct.  If module B augment X in module A,
>>>> and X is obsolete, it does NOT mean that the augmented nodes in B are
>>>> automatically obsolete.  However, in an implementation that doesn't
>>>> implement X, the augmented nodes from B are obviously also not
>>>> implemented.
>>>>
>>> I can get where you are coming from, but if you had a GUI viewer that
>>> was looking at the combined schema tree, I think that you would to see
>>> those descendant children nodes marked in some way to indicate that
>>> implementations may validly not return them. Reporting them as current
>>> when one of their parent nodes was obsolete would seem to be
>>> deceptive.
>>>
>>> Is it that you are trying to differentiate between being explicitly
>>> obsolete vs 'implicitly obsolete' through parentage?
>>>
>> I think that within a module, if a parent is obsolete, then all its
>> child should also be obsolete (*).  But I do think that the status
>> should be explicitly stated.
>>
> OK.  I assume that this statement applies to deprecated as well.  I don't
> feel particularly strongly on this point.  If you mark something as
> obsolete/deprecated, then explicitly having to find and mark all
> references/children doesn't seem like a bad thing because it makes the full
> impact obvious (if pyang is enhanced to check for this).
>
>
>> But marking definition as obsolete in one module cannot automatically
>> make definitions in *other* modules obsolete.
>>
> I'm not so sure.
>
> It seems to me that in practice, they are directly equivalent as if they
> were marked as obsolete.  I.e. clients cannot rely on them being available
> because the obsolete parent may not be implemented.
>
> If the augmenting module wants to keep those nodes, then their only choice
> seems to be to explicitly mark them as obsolete, and make a copy of the
> nodes augmenting somewhere else in the schema tree.
>
>
>
>> (*) _maybe_ 7950 can be interpreted in this way when it says:
>>
>>     If a definition is "current", it MUST NOT reference a "deprecated" or
>>     "obsolete" definition within the same module
>>
>> If you're in a good mood, you could argue that a child always
>> "references" its parent.
>>
> Would it not be better to add some sort of explicit statement as an errata
> to 7950 (once there is agreement on what it should say)?  Or is this beyond
> the scope of what an errata is allowed to do?
>
>
I think the current text is pretty bad.
The term "references" is not very useful and it is not defined anywhere.
IMO a child node implicitly references its parent.  Any child node
could be refactered as an augment:

   container X {
      status obsolete;
      leaf Y {}
   }

equivalent to:


  augment /X {
     leaf Y {}
  }

  container X {
     status obsolete;
  }


Does the augment reference X?  I would say yes.

Even more distressing to me is that the definition of 'obsolete'
says SHOULD NOT implement.  There is no guidence on when
it is OK to ignore the SHOULD NOT.

Also, a deviation-stmt is not allowed to alter the status-stmt.
This seems wrong.  There is no discovery mechanism for a client
to reliably determine what the server implements.

I would prefer that the server advertise a deviation stating explicity
that the server is ignoring the status-stmt

  deviation /X {
     deviate replace {
        status deprecated;
     }
  }

But this is not even permitted by the YANG language.





> Rob
>

Andy


>
>
>>
>> /martin
>> .
>>
>>
>