On 30 Apr 2015, at 04:53, Jason T. Greene <jason.greene(a)redhat.com> wrote:
Instead of hard errors, and manipulating the old model, wouldn't it be better to just
convert and then report back in the response what was dropped?
I’m not sure to understand your remark. Could you clarify?
I don’t manipulate the old model. I describe it and use the description to create the :add
operations for the new subsystem.
At first, I was reading the old model, manipulating it to create the new subsystem model
and create a new Resource with that manipulated model.
It turns out to be a bad idea as I was bypassing any validation steps performed by the
:add operations and ended up with an invalid new subsystem (that could not be loaded).
Using the ":describe + new :add operations" approach ensures that my new
subsystem will be valid if my :migrate operation succeeds.
--
Jeff Mesnil
JBoss, a division of Red Hat
http://jmesnil.net/