[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] JobTransform query



> Parse_config if error: 'HighPrioAcctGroup == "group_HIGHPRIO" is not a valid if condition because complex conditionals are not supported'

 

Yes, complex conditionals are not supported, but  in this case I think you can take advantage of the fact that

The three argument form of userMap() will return undefined if the user does not map.

 

    IF defined MY.x509UserProxyVOName

        # Start by mapping high priority users, if the user is not in this map, undefined will be the result

        EVALSET HighPrioAcctGroup usermap("HighPrioAccountMap",Owner,undefined)

        IF defined HighPrioAcctGroup

            SET RalAcctGroup HighPrioAcctGroup

        ELSE

            EVALSET RalAcctGroup usermap("VOAcctGroupMap",x509UserProxyVOName, undefined)

        ENDIF

    ENDIF

 

Notice that I have also changed the second use of usermap to use the 3 argument form.  This is because

The two argument form of usermap returns a *list* of groups, not a single group.   If your map files only have single values then the list is the same as the first item in the list, but it is best not to assume that in your transform.

 

You might also want to use the 4 argument form of usermap for the second use usermap above.  The 4 argument form allows you to specify a value to use for cases when the user is not found in the map.

 

-tj