How to refine an attribute present in a container ?


Satish Dutt
 

Hi,

 

I have three groups A, B and C. I am trying to refine the attribute "password" in  grouping C  as below :

 

grouping A {

        leaf password {

            type string;

            description "Password to connect the connector";

        }

}

 

grouping B {

                container connector-configs {

                                uses A;

                                leaf mgmt-ip {

                                                type inet-types:ipv4-address;

                                                description "IP address of the connector";

                                }

                }

}

 

grouping C {

                uses B {

                refine "password" {

                                default "password";

                }

}

 

 

But when I compile I am getting an exception  [ERROR] yang-to-sources: Unable to parse yang files from C:\workspace\controller\controller\odl\controllerconfiguration\api\src\main\yang

java.lang.IllegalArgumentException: Refine target node Relative{path=[(......]} not found

 

From the error I am able to understand that the path to the attribute is wrong when refine statement is used. But how do we refine an attribute which is inside a container ?

 

Regards

-Satish


Igor Foltin -X (ifoltin - PANTHEON TECHNOLOGIES@Cisco) <ifoltin@...>
 

Hello Satish,


you need to write that refine like this: refine "connector-configs/password" {...}


Regards,


Igor


Od: controller-dev-bounces@... <controller-dev-bounces@...> v mene používateľa Satish Dutt <SDutt@...>
Odoslané: 14. marca 2017 9:30
Komu: yangtools-users@...; yang-push-dev@...; yangtools-dev@...; controller-dev@...; controller-users@...
Predmet: [controller-dev] How to refine an attribute present in a container ?
 

Hi,

 

I have three groups A, B and C. I am trying to refine the attribute "password" in  grouping C  as below :

 

grouping A {

        leaf password {

            type string;

            description "Password to connect the connector";

        }

}

 

grouping B {

                container connector-configs {

                                uses A;

                                leaf mgmt-ip {

                                                type inet-types:ipv4-address;

                                                description "IP address of the connector";

                                }

                }

}

 

grouping C {

                uses B {

                refine "password" {

                                default "password";

                }

}

 

 

But when I compile I am getting an exception  [ERROR] yang-to-sources: Unable to parse yang files from C:\workspace\controller\controller\odl\controllerconfiguration\api\src\main\yang

java.lang.IllegalArgumentException: Refine target node Relative{path=[(......]} not found

 

From the error I am able to understand that the path to the attribute is wrong when refine statement is used. But how do we refine an attribute which is inside a container ?

 

Regards

-Satish