'Load instance flavor information from instance_extra.'

def _flavor_from_db(self, db_flavor):

    flavor_info = jsonutils.loads(db_flavor)
    self.flavor = objects.Flavor.obj_from_primitive(flavor_info['cur'])
    if flavor_info['old']:
        self.old_flavor = objects.Flavor.obj_from_primitive(flavor_info['old'])
    else:
        self.old_flavor = None
    if flavor_info['new']:
        self.new_flavor = objects.Flavor.obj_from_primitive(flavor_info['new'])
    else:
        self.new_flavor = None
    self.obj_reset_changes(['flavor', 'old_flavor', 'new_flavor'])
