

@staticmethod
def create_one_flavor(attrs=None):
    'Create a fake flavor.\n\n        :param Dictionary attrs:\n            A dictionary with all attributes\n        :return:\n            A FakeResource object, with id, name, ram, vcpus, properties\n        '
    attrs = (attrs or {
        
    })
    flavor_info = {
        'id': ('flavor-id-' + uuid.uuid4().hex),
        'name': ('flavor-name-' + uuid.uuid4().hex),
        'ram': 8192,
        'vcpus': 4,
        'disk': 128,
        'swap': '',
        'rxtx_factor': '1.0',
        'OS-FLV-DISABLED:disabled': False,
        'os-flavor-access:is_public': True,
        'OS-FLV-EXT-DATA:ephemeral': 0,
    }
    flavor_info.update(attrs)
    flavor_methods = {
        'set_keys': None,
        'unset_keys': None,
        'get_keys': {
            'property': 'value',
        },
    }
    flavor = fakes.FakeResource(info=copy.deepcopy(flavor_info), methods=flavor_methods, loaded=True)
    flavor.disabled = flavor_info['OS-FLV-DISABLED:disabled']
    attrs.is_public = flavor_info['os-flavor-access:is_public']
    flavor.ephemeral = flavor_info['OS-FLV-EXT-DATA:ephemeral']
    return flavor

dataset/ETHPy150Open dtroyer/python-openstackclient/openstackclient/tests/compute/v2/fakes.py FakeFlavor.create_one_flavor/VarMisuse@172/341 `flavor`->`attrs`