This patch moves validation of constraints out of the constructor of
schema objects into a separate method that can be invoked on the
schema objects after creation. This gives us more control over when
validation shall be invoked.
This patch fixes an issue with custom constraints that could not be
validated when having a default value, since they require the RPC
context to be present. However, the context was not present in the
places where needed.
The short-sighted fix would have been to change a lot of method
signatures to pass the context properly, but that did not seem to be
really clean. The better fix seemed to be to move validation into
a separate method that can be invoked with the proper context. This
will also give us more control on when we do validation, and which
validation we do.
This patch
Closes-Bug: #1314240
This patch will also enable to fix
Partial-Bug: #1314401
For that bug it will be necessary to switch off validation under
certain conditions, which was not possible before when doing
validation right in the constructor.
Reviewed: https:/ /review. openstack. org/99011 /git.openstack. org/cgit/ openstack/ heat/commit/ ?id=aa7c0306bcc 77320b670e0e158 95b4b6b3944250
Committed: https:/
Submitter: Jenkins
Branch: stable/icehouse
commit aa7c0306bcc7732 0b670e0e15895b4 b6b3944250
Author: Thomas Spatzier <email address hidden>
Date: Wed Apr 30 19:18:16 2014 +0200
Do not validate constraints in schema constructor
This patch moves validation of constraints out of the constructor of
schema objects into a separate method that can be invoked on the
schema objects after creation. This gives us more control over when
validation shall be invoked.
This patch fixes an issue with custom constraints that could not be
validated when having a default value, since they require the RPC
context to be present. However, the context was not present in the
places where needed.
The short-sighted fix would have been to change a lot of method
signatures to pass the context properly, but that did not seem to be
really clean. The better fix seemed to be to move validation into
a separate method that can be invoked with the proper context. This
will also give us more control on when we do validation, and which
validation we do.
This patch
Closes-Bug: #1314240
This patch will also enable to fix
Partial-Bug: #1314401
For that bug it will be necessary to switch off validation under
certain conditions, which was not possible before when doing
validation right in the constructor.
Cherry-pick from review https:/ /review. openstack. org/#/c/ 91485 c2d299ada616a46 48e00f4333)
(cherry picked from commit 19f83e84269e1ae
Conflicts:
Change-Id: I19e1fb520551eb 42bf36bb380f1cc 28c81bbaedd