PYANG does much of what you request if you ask for a tree, jstree output. It 
probably could create a yang output with some work.
Balazs

From: Andy Bierman [mailto:a...@yumaworks.com]
Sent: Tuesday, 04 October, 2016 18:56
To: Balázs Lengyel <balazs.leng...@ericsson.com>
Cc: netmod@ietf.org
Subject: Re: [netmod] deviation-stmt (7.20.3)



On Fri, Sep 30, 2016 at 9:01 AM, Balazs Lengyel 
<balazs.leng...@ericsson.com<mailto:balazs.leng...@ericsson.com>> wrote:

My biggest problem with deviations is that a number of things can not be 
deviated:

  *   description
  *   reference


This does seem quite useful.
I wonder why it got left out.

The way deviations work is rather counter-intuitive to those of us who think
of deviations as source code patches.  Almost all deviations are source code 
patches,
except type-stmt, and some default-stmt replacements.

It would be nice if a YANG tool could process all the deviations advertised by 
the server
and produce a set of valid "deviated modules" which could then be fed to a YANG 
compiler
that did not support deviations.  This is non-trivial and not always possible, 
because of the type-stmt
and possible import loops.



Regards Balazs


Andy

On 2016-09-30 00:22, Andy Bierman wrote:
Hi,

The deviation section has a lot of fluff text about how bad deviations are,
but very little text on how to process the "deviate" statement correctly.

The text is not clear if the statements altered in the target module
are semantic patches or syntactic patches.  Are the sub-statements
of the deviate-stmt fully processed in the scope of the deviation module
or in the scope of the target module? In this example, is the type-stmt
resolved in A or dev-A?

Similar issues for deviating a default for an identityref.


  module A {
    namespace "...";
    prefix a;
    // no imports!

    leaf foo {
       type string;
     }

    leaf bar {
       type string;
     }

    leaf baz {
       type string;
     }
  }

  module A-dev {
    ...
    import A { prefix a; }
    import C { prefix c; }
    import ietf-interfaces { prefix if; }

    // variant 1: inline leafref but module A does not import path module
    deviation /a:foo {
       deviate replace {
          type leafref {
               base /c:modules/c:module/c:name;
           }
        }
     }


   // variant 2: imported typedef but module A does not import it
    deviation /a:bar {
       deviate replace {
          type if:interface-ref;
        }
     }


    // variant 3: local typedef but module A cannot import it (circular imports)
    typedef mystring {
        type string { length "1..10"; }
    }

    deviation /a:baz {
       deviate replace {
          type mystring;
        }
     }
  }


Andy



_______________________________________________

netmod mailing list

netmod@ietf.org<mailto:netmod@ietf.org>

https://www.ietf.org/mailman/listinfo/netmod



--

Balazs Lengyel                       Ericsson Hungary Ltd.

Senior Specialist

Mobile: +36-70-330-7909              email: 
balazs.leng...@ericsson.com<mailto:balazs.leng...@ericsson.com>

_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to