Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clixon handle if-feature incorrectly #555

Closed
trentzhou opened this issue Sep 18, 2024 · 1 comment
Closed

Clixon handle if-feature incorrectly #555

trentzhou opened this issue Sep 18, 2024 · 1 comment

Comments

@trentzhou
Copy link

I created this simple yang:

module shelf-slot-test {
    namespace "urn:example:shelf-slot-test";
    prefix shelf-slot-test;

    revision 2024-09-17 {
        description "test";
    }

    container config {
    }

    augment /config {
        container system {
        }
    }

    feature enable-shelf {
        description "enable shelf";
    }
    augment /config/system {
        list shelf {
            // This breaks clixon!
            if-feature shelf-slot-test:enable-shelf;

            key location;
            description "location of the shelf";

            leaf location {
                type string;
            }
        }
        list slot {
            key location;
            description "location of the slot";

            leaf location {
                type string;
            }
        }
    }

    augment '/config/system/slot' {
        leaf v1 {
            type int32;
        }
    }
}

When I launch clixon_backend without , it reports error:

Sep 18 02:27:29.045455: yang_augment_node: 298: Yang error: Augment failed in module shelf-slot-test: target node /config/system/slot not found
Sep 18 02:27:29.045538: clixon_backend: 14443 Terminated retval:-1

A workaround is to add the following line to the config file:

<CLICON_FEATURE>shelf-slot-test:enable-shelf</CLICON_FEATURE>

But /config/system/slot should not be controlled by this feature.

@trentzhou
Copy link
Author

Verified, please close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants