Re: [netmod] Module update rules: changing a type to a union

Martin Bjorklund <mbj@tail-f.com> Mon, 13 August 2018 10:08 UTC

Return-Path: <mbj@tail-f.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 07320130EC1 for <netmod@ietfa.amsl.com>; Mon, 13 Aug 2018 03:08:20 -0700 (PDT)
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, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] 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 MdtPZfV2--JM for <netmod@ietfa.amsl.com>; Mon, 13 Aug 2018 03:08:18 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 97CC8130EBF for <netmod@ietf.org>; Mon, 13 Aug 2018 03:08:18 -0700 (PDT)
Received: from localhost (unknown [173.38.220.61]) by mail.tail-f.com (Postfix) with ESMTPSA id 2B3561AE0144; Mon, 13 Aug 2018 12:08:17 +0200 (CEST)
Date: Mon, 13 Aug 2018 12:08:16 +0200
Message-Id: <20180813.120816.949834847603219014.mbj@tail-f.com>
To: jason.sterne@nokia.com
Cc: netmod@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <VI1PR07MB39818C462606D318A99672B19B240@VI1PR07MB3981.eurprd07.prod.outlook.com>
References: <VI1PR07MB39818C462606D318A99672B19B240@VI1PR07MB3981.eurprd07.prod.outlook.com>
X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/yQSrlqFnrMEibLwuzMkyWt63kXQ>
Subject: Re: [netmod] Module update rules: changing a type to a union
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.27
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: Mon, 13 Aug 2018 10:08:20 -0000

"Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com> wrote:
> Hi all,
> 
> I'm uncertain about how to interpret the YANG module update rules when a type changes to a union.
> 
> Is the following change allowed?
> 
> From:
>   typedef my-type {
>     type enumeration {
>       enum "foo";
>     }
>   }
> To:
>   typedef my-type {
>     type union {
>       type enumeration {
>         enum "foo";
>       }
>       type uint32;
>     }
>   }
> 
> The general spirit of the rules is that expanding the value space is generally OK, but this case does seem to violate this paragraph of section 11:
> 
>    o  A "type" statement may be replaced with another "type" statement
>       that does not change the syntax or semantics of the type.  For
>       example, an inline type definition may be replaced with a typedef,
>       but an int8 type cannot be replaced by an int16, since the syntax
>       would change.

Right.  I think that changing from an enumeration to a union changes
the syntax of the type, so this would not be allowed.


/martin


> 
> 
> Does the addition of the union change the semantics of the type if that union encompasses the original type?
> 
> With XML encoding I can see how an "old" client could easily still communicate with a "new" server for this change. But I wonder about other possible encodings that might change when a type becomes a union that contains additional types.
> 
> Regards,
> Jason