

def test_flavor_is_not_created_if_already_exists_on_dest(self):
    existing_flavor = mock.Mock()
    existing_flavor.id = 'existing-id'
    existing_flavor.name = 'existing-name'
    existing_flavor.is_public = True
    existing_flavor.ram = 48
    existing_flavor.vcpus = 1
    existing_flavor.disk = 0
    existing_flavor.ephemeral = 1
    existing_flavor.swap = 0
    existing_flavor.rxtx_factor = 1.0
    flavors = {
        config.id: {
            'flavor': {
                'is_public': True,
                'name': existing_flavor.name,
                'tenants': [],
                'ram': 48,
                'vcpus': 1,
                'disk': 0,
                'ephemeral': 1,
                'swap': 0,
                'rxtx_factor': 1.0,
            },
            'meta': {
                
            },
        },
    }
    config = mock.Mock()
    config.migrate.override_rules = None
    cloud = mock.MagicMock()
    cloud.position = 'dst'
    nc = nova_compute.NovaCompute(config, cloud)
    nc._create_flavor_if_not_exists = mock.Mock()
    nc.get_flavor_list = mock.Mock()
    nc.get_flavor_list.return_value = [existing_flavor]
    nc._deploy_flavors(flavors, tenant_map={
        
    })
    assert (not nc._create_flavor_if_not_exists.called)

dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/tests/lib/os/compute/test_nova.py FlavorDeploymentTestCase.test_flavor_is_not_created_if_already_exists_on_dest/VarMisuse@76/129 `existing_flavor`->`config`