[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [HTCondor-users] job transform: change requirement condition?
- Date: Wed, 10 Oct 2018 16:40:03 +0000
- From: Michael Pelletier <Michael.V.Pelletier@xxxxxxxxxxxx>
- Subject: Re: [HTCondor-users] job transform: change requirement condition?
I think you're right that it's a type issue - regexps returns a String type, which would just be a constant once evaluated. So maybe just add an eval() around the regexps?
Michael V. Pelletier
Digital Transformation & Innovation
Integrated Defense Systems
From: HTCondor-users [mailto:htcondor-users-bounces@xxxxxxxxxxx] On Behalf Of Thomas Hartmann
Sent: Wednesday, October 10, 2018 12:23 PM
Subject: [External] Re: [HTCondor-users] job transform: change requirement condition?
thanks for the tip with regexps. Unfortunately, the way I have added it to my job transform seems to have no effect so far.
The job transform should in principle format the Requirement string  but still the resulting job's ad is the old one 
>From the documentation on regexps I would assume that it should work - but I am not sure, if 'Requirements' is a 'string target' (should be as a class ad, or?). Scanning through target also should match and replace substrings, or?
Cheers and thanks,
JOB_TRANSFORM_NAMES = $(JOB_TRANSFORM_NAMES), FOOFORM JOB_TRANSFORM_FOOFORM @=end [ copy_Requirements = BaseRequirements set_Requirements = regexps("OpSysAndVer\s*=\?*=\s*\"SL6\"",
BaseRequirements, "OpSysAndVer == \"CentOS7\"") ] @end
> condor_history -l JOB.ID
>> Requirements = ( OpSysAndVer == "SL6" ) && ( TARGET.Arch == "X86_64"
) && ...
(String pattern, String target, String substitute [ , String options
]) Uses the description of a regular expression given by string pattern to scan through the string target. When target is a regular expression as described by pattern, the string substitute is returned, with backslash expansion performed. If any argument is not a string, returns ERROR.
On 2018-10-10 15:08, Michael Pelletier wrote:
> Seems like you're looking for "regexps()" - to substitute something in the requirements string.
> So you'd match the job with your requirements expression where it's demanding SL6, and then your job transform would do something like this:
> Copy_requirements = RequiresScientificLinux6 Requirements =
> regexps("OpSysAndVer\s*=\?*=\s*\"SL6\"", RequiresScientificLinux6,
> "OpSysAndVer == \"CentOS6\"")
> That ought to do the trick, I think.
> Michael V. Pelletier
> Information Technology
> Digital Transformation & Innovation
> Integrated Defense Systems
> Raytheon Company
> HTCondor-users mailing list
> To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx
> with a
> subject: Unsubscribe
> You can also unsubscribe by visiting
> The archives can be found at: