Check that the function passed really exists

def verify_fun(lazy_obj, fun):
    '''
    Check that the function passed really exists
    '''
    if not fun:
        raise salt.exceptions.SaltInvocationError(
            'Must specify a function to run!\n'
            'ex: manage.up'
        )
    if fun not in lazy_obj:
        # If the requested function isn't available, lets say why
        raise salt.exceptions.CommandExecutionError(lazy_obj.missing_fun_string(fun))