make security group rule ID mandatory in YANG model 63/73663/1
authorMichael Vorburger <vorburger@redhat.com>
Mon, 2 Jul 2018 18:47:42 +0000 (20:47 +0200)
committerMichael Vorburger <vorburger@redhat.com>
Mon, 2 Jul 2018 18:47:42 +0000 (20:47 +0200)
commitc671b6ae8b9ffbfa5de5279c029d95bff0521d3a
treea68f522298636e24c72432c8394136f0c44d55e3
parent59a7c333e9d7f110d46beca779a2735710504319
make security group rule ID mandatory in YANG model

To simplify the dependency check - it is not really the role of the new
areAllDependenciesAvailable() method to enforce required properties
programmatically - doing that declaratively in the YANG model is the
ODL way.

This lets us re-activate a test which covers this scenario which we had
to temporarily comment out in the previous to previous commit for "add
dependency check for security rule's group update(), not just add()";
we need the previous commit re. "propagate datastore exceptions all the
way to northbound" for YANG mandatory constraints to actually have any
effect (because before that, we basically just stupidly ignored ANY
problem when commiting the transaction!).

Changing this also reveals a subtle mistake in an existing test:
Modifying an existing entity without required fields is not actually
working / supported (never was; it's not that this break it) - an MD SAL
put() is does *NOT* apply a delta, but replaces the existing object.  A
few Neutron Northbound classes override the updateDelta() method of
AbstractNeutronNorthbound with custom logic which seems to attempt to
"compensate" for this be doing e.g. delta.setID(uuid); etc. but this is
implemented inconsistently in existing code (e.g. many including the
NeutronSecurityRulesNorthbound do not do this).

Many more fields in the model which in truth are mandatory should
ideally be so declared in follow-up changes imitating this one now.

JIRA: NEUTRON-158
Change-Id: I077906a682225ac87caf1c4c933f01bdf40c1353
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
integration/test-standalone/src/main/java/org/opendaylight/neutron/e2etest/NeutronSecurityRuleTests.java
model/src/main/yang/neutron-secgroups.yang