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

Re: [HTCondor-users] Requirements statement to exclude a list of machines in a file

On 5/11/2021 10:39 PM, Hitchen, Greg (IM&T, Kensington WA) wrote:
Hi All

Quick question.

I know how to exclude a certain machine (or a few), e.g. with the requirements = (Machine =!= "unwanted_machine.something)
type of statement, or even using it with regexp, but, what about a list of 200+ randomly named machines listed in a file?

Is there a quick/easy/hard/kludgy/dirty way of doing this?

Hi Greg,

Curious, what is your motivation for this?

At any rate, a quick-n-dirty example off the top of my head would look like the below.  Maybe there is a better / more elegant way, especially if you care to use Python, but this is the first thing that came to mind using the command-line tools:

Contents of file "badlist.txt":

# List of machines to avoid, note the backslash
# character serving as a line-continuation at the end
# of each line.
BadList = \
foo.xxx.edu \
bar.xxx.edu \
alpha.xxx.edu \

Contents of your submit file:

executable = foo.exe
requirements = stringListIMember(Machine,"$(BadList)")==False
include : badlist.txt

Hope this helps,