Do not check flavor.id after Microversion 2.46

flavor.id is longer included in server info after Microversion
2.46, so change to checking flavor info if 'id' is not in flavor.

Note: We needn't check whether 'id' should be in flavor or not in
different microversions because schema check already covers it.

Besides, this is to make resize_server in base.py instance method,
because it's not likely to be used in resource_setup, and so we can
use assert check in it.

Ref: https://developer.openstack.org/api-ref/compute/#rebuild-server-rebuild-action

Implements blueprint: clear-deprecated-api

Change-Id: Id376de39662a4799909b56ec1148c85910d95814
diff --git a/tempest/api/compute/admin/test_migrations.py b/tempest/api/compute/admin/test_migrations.py
index a6b71b2..e030575 100644
--- a/tempest/api/compute/admin/test_migrations.py
+++ b/tempest/api/compute/admin/test_migrations.py
@@ -106,7 +106,7 @@
                                        'ACTIVE')
 
         server = self.servers_client.show_server(server['id'])['server']
-        self.assertEqual(flavor['id'], server['flavor']['id'])
+        self.assert_flavor_equal(flavor['id'], server['flavor'])
 
     def _test_cold_migrate_server(self, revert=False):
         if CONF.compute.min_compute_nodes < 2: