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


On 6/23/2016 11:23 AM, Marc Jackson - NOAA Affiliate wrote:
Hello All,

I'm hoping someone can help me. I am trying to add restrictions to my
accounting_group. I added the following to my condor_config file:

SUBMIT_REQUIREMENT_GROUP1 = (Accounting_Group !=
"group_arr_prep_validation") || (Accounting_Group ==
"group_arr_prep_validation" && (Owner=="mfan"))
SUBMIT_REQUIREMENT_GROUP1_REASON="User not in group_arr_prep_validation"

My user name is "mjackson" and I am still able to submit jobs under
"group_arr_prep_validation" with my user name. Can anyone tell me what
I'm doing wrong?

Thanks in advance,

I see two problems above.

First, I think you should use the "meta" operators, specifically =?= instead of == and =!= instead of !=, so that your expression evaluates to either True or False even if the user fails to specify any accounting_group; without doing this, the expression could evaluate to UNDEFINED. See https://is.gd/CPghGb for details.

Second, realize that the job submit file is not a job classad. When you run condor_submit, condor_submit converts the job submit file into a classad, and sometimes one line in the submit file ends up setting multiple attributes in the job classad (perhaps with different names). The submit requirements expressions needs to operate on a job classad; specifically, when you use "accounting_group = foo" in the submit file, condor_submit inserts two attributes names "AcctGroup" and "AccountingGroup" into the job classad. Doing a "condor_q -l" on a job you submitted is a good way to see how the submit file got transformed into a job classad. Behold:

  C:\temp>type test.sub

  executable = test.exe
  accounting_group = foo
  hold = true

  C:\temp>condor_submit smell.sub
  Submitting job(s).
  1 job(s) submitted to cluster 79.

  C:\temp>condor_q -l 79.0 | grep foo
  AccountingGroup = "foo.tannenba"
  AcctGroup = "foo"

So to finally answer your question, I think you want to rewrite your requirement line above like so:

SUBMIT_REQUIREMENT_GROUP1 = (AcctGroup =!= "group_arr_prep_validation") || (AcctGroup =?= "group_arr_prep_validation" && (Owner=="mfan"))

Hope the above helps