Subject: [netmod] Submodule import of the same module with different prefixes

From: Robert Wilton <[email-masked]>
Date: Tue, 14 Jun 2016 11:23:33 +0100

Hi,

In YANG 1.1, are modules and related sub-modules allowed to import the 
same module with different prefixes?

is the following example sane? I.e. where the ietf-yang-types module is 
being imported with 3 different prefixes:

module example-system {
   yang-version 1.1;
   namespace "urn:example:system";
   prefix "sys";

   import ietf-yang-types {
     prefix "yang";
   }

   include example-types;
   include example-types-2;

   description
     "The module for entities implementing the Example system.";

   revision 2007-06-09 {
     description "Initial revision.";
   }

   // definitions follow...
}

submodule example-types {
   yang-version 1.1;
     belongs-to "example-system" {
     prefix "sys";
   }

   import ietf-yang-types {
     prefix "yang-types";
   }

   description
     "This submodule defines common Example types.";

   revision "2007-06-09" {
     description "Initial revision.";
   }

// definitions follows...
}

submodule example-types-2 {
   yang-version 1.1;
     belongs-to "example-system" {
     prefix "sys";
   }

   import ietf-yang-types {
     prefix "ietf-types";
   }

   description
     "Also imports ietf-yang-types but with a different prefix";

   revision "2007-06-09" {
     description "Initial revision.";
   }

// definitions follows...
}

Thanks,
Rob

---

From: Martin Bjorklund <[email-masked]>
Date: Tue, 14 Jun 2016 12:29:48 +0200 (CEST)

> same module with different prefixes?

Yes.

/martin

> 
> is the following example sane? I.e. where the ietf-yang-types module
> is being imported with 3 different prefixes:
> 
> module example-system {
>   yang-version 1.1;
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod
>