acidjunk / acidjunk/pyang

pyang should re-check config flags after deviations + invalidating before running tests again

Aperta
#78 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
auto-migrated Priority-Medium Type-Defect
Lingua principale
Python
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

```
You should make an additional check within
statements.v_reference_deviation_4(ctx, stmt) which re-checks the entire target
module for illegaly set config flags.

In module with prefix "a":

container interface-stats {
config false;
leaf in-pkts {
type int32;
}
}

In another module which imports the above module:

deviation /a:interface-stats/a:in-pkts {
deviate add {
config true;
}
}

This should generate an error, saying that config true cannot be set when a
parent has config false set. It currently doesn't.

Perhaps calling statements.v_inherit_properties(ctx, stmt) again with target
module in the argument will do the trick. config-stmt is an inherited property
anyways so recalling this method is actually a must when config flags get
deviated (you need to re-inherit).

Also "invalidating" target statements before re-running the tests on them after
deviations makes sense to me. As far as I remember you check
Statement.i_is_validated in some functions. You should invalidate this member
before making any re-checks or you might end up checking nothing. :)

```

Original issue reported on code.google.com by `jernej.t...@gmail.com` on 12 Sep 2012 at 12:25

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.