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

Re: [HTCondor-users] Using owner as a constraint



Hi Joe,

On Sat, Jun 17, 2023 at 3:34âPM Joseph Areeda <newsreply@xxxxxxxxxx> wrote:

I'm working on a python program to find any jobs in a weird state. Long story irrelevant to the question. The point is my question is related to querying Schedd from python not running condor_q from the command line. But easier to demo there

The program will run on an AP with lots of users but I want to constrain the query to the current user.

In case it helps, you don't necessarily have to use an explicit constraint in Schedd.query() to do this, you can also provide an opts argument, specifically "opts = htcondor.QueryOpts.DefaultMyJobsOnly", which will give you the same default behavior as condor_q to show the user only their jobs.

https://htcondor.readthedocs.io/en/latest/apis/python-bindings/api/htcondor.html#htcondor.Schedd.query
https://htcondor.readthedocs.io/en/latest/apis/python-bindings/api/htcondor.html#htcondor.QueryOpts

Jason