def _get_preset_id(package, size):
    """Get the preset id given the keyName of the preset."""
    for preset in package['activePresets'] + package['accountRestrictedActivePresets']:
        if preset['keyName'] == size or preset['id'] == size:
            return preset['id']

    raise SoftLayer.SoftLayerError("Could not find valid size for: '%s'" % size)
def _get_preset_id ( package , size ) : for preset in package [ 'activePresets' ] + package [ 'accountRestrictedActivePresets' ] : if preset [ 'keyName' ] == size or preset [ 'id' ] == size : return preset [ 'id' ] raise SoftLayer . SoftLayerError ( "Could not find valid size for: '%s'" % size )
Get the preset id given the keyName of the preset.