def assert_flavor_equal(self, flavor_id, server_flavor):
    'Check whether server_flavor equals to flavor.\n\n        :param flavor_id: flavor id\n        :param server_flavor: flavor info returned by show_server.\n        '
    if server_flavor.get('id'):
        msg = 'server flavor is not same as flavor!'
        self.assertEqual(flavor_id, server_flavor['id'], msg)
    else:
        flavor = self.flavors_client.show_flavor(flavor_id)['flavor']
        self.assertEqual(flavor['name'], server_flavor['original_name'], 'original_name in server flavor is not same as flavor name!')
        for key in ['ram', 'vcpus', 'disk']:
            msg = ('attribute %s in server flavor is not same as flavor!' % key)
            self.assertEqual(flavor[key], server_flavor[key], msg)
Check whether server_flavor equals to flavor.

:param flavor_id: flavor id
:param server_flavor: flavor info returned by show_server.
def assert_flavor_equal(self, flavor_id, server_flavor):
    'Check whether server_flavor equals to flavor.\n\n        :param flavor_id: flavor id\n        :param server_flavor: flavor info returned by show_server.\n        '
    if server_flavor.get('id'):
        msg = 'server flavor is not same as flavor!'
        self.assertEqual(flavor_id, server_flavor['id'], msg)
    else:
        flavor = self.flavors_client.show_flavor(flavor_id)['flavor']
        self.assertEqual(flavor['name'], server_flavor['original_name'], 'original_name in server flavor is not same as flavor name!')
        for key in ['ram', 'vcpus', 'disk']:
            msg = ('attribute %s in server flavor is not same as flavor!' % key)
            self.assertEqual(flavor[key], server_flavor[key], msg)