Exemplo n.º 1
0
bool UserAf::v_canRunOn( RenderAf * i_render)
{
    if( false == v_canRun())
    {
        // Unable to run at all
        return false;
    }

// Check nimby:
    if( i_render->isNimby() && (m_name != i_render->getUserName())) return false;

// check hosts mask:
    if( false == checkHostsMask( i_render->getName())) return false;
// check exclude hosts mask:
    if( false == checkHostsMaskExclude( i_render->getName())) return false;

// Returning that user is able to run on specified render
    return true;
}
Exemplo n.º 2
0
bool JobAf::v_canRunOn( RenderAf * i_render)
{
	if( false == v_canRun())
	{
		// Unable to run at all
		return false;
	}
	
	// Check Render Nimby:
	if( false == isIgnoreNimbyFlag())
	{
		if( i_render->isNIMBY())
			return false;

		if( i_render->isNimby())
			if( i_render->getUserName() != m_user_name )
				return false;
	}

	// Check Render Paused:
	if( false == isIgnorePausedFlag())
	{
		if( i_render->isPaused())
			return false;
	}

	// check maximum running tasks per host:
	if(( m_max_running_tasks_per_host  > 0 ) && ( getRenderCounts(i_render) >= m_max_running_tasks_per_host ))
	{
		return false;
	}
	
	// check at least one block can run on render
	bool blockCanRunOn = false;
	for( int b = 0; b < m_blocks_num; b++)
	{
		if( m_blocks[b]->canRunOn( i_render))
		{
			blockCanRunOn = true;
			break;
		}
	}
	if( false == blockCanRunOn )
		return false;
	
	// check hosts mask:
	if( false == checkHostsMask( i_render->getName()))
	{
		return false;
	}
	
	// check exclude hosts mask:
	if( false == checkHostsMaskExclude( i_render->getName()))
	{
		return false;
	}
	
	// check needed os:
	if( false == checkNeedOS( i_render->getHost().m_os))
	{
		return false;
	}
	
	// check needed properties:
	if( false == checkNeedProperties( i_render->getHost().m_properties))
	{
		return false;
	}
	
	return true;
}