Nova has a copy of compare_obj and Cinder needs to start using the
same thing, so move compare_obj to the fixture module so other projects
that are already using oslo.versionedobjects fixtures can re-use this.
The if check at the beginning of the function was changed over because
one of the unit tests uncovered a case with undesirable failing.
Co-Authored-By: Ryan Rossiter <rlrossit@us.ibm.com>
Change-Id: I0bcfa7d4f501bd69b6343e4d719e98eb32a5a5cd