Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-455

Default value may have problems

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 3273

      First, it seems that yangtools doesn't check default value. Like the model below:
      typedef device-id {
      type uint32;
      }
      leaf device-id {
      type zenic-types:device-id;
      default "abc";
      }
      Build always success.

      Second, it will be null if doesn't set value using a builder rather than the default value:
      typedef device-id {
      type uint32;
      }
      typedef port-id {
      type uint32;
      }
      conatiner test {
      leaf dev-id

      { type device-id; mandatory "true"; }

      leaf p-id

      { type port-id; default 0; }

      }
      If doesn't set p-id to 0 hard coding, after put and submit to datastore, there won't be p-id node.
      Version is Helium-SR3.

            Unassigned Unassigned
            chen.xi26@zte.com.cn Leo Cat
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: