[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[HTCondor-users] condor_history using the python bindings
- Date: Wed, 24 Jun 2015 10:42:18 -0400
- From: Jose Caballero <jcaballero.hep@xxxxxxxxx>
- Subject: [HTCondor-users] condor_history using the python bindings
# uname -r
$CondorVersion: 8.2.3 Sep 30 2014 BuildID: 274619 $
$CondorPlatform: x86_64_RedHat6 $
I am trying to run a command like this (*) using the python bindings.
That command runs perfectly on the command line.
However, I am not sure I totally understand the meaning of the
description for the parameters provided by the inline documentation
I have tried something like this (***), but the output is an empty
iterator. Looping over it gives nothing.
Is this (****) the only way at the time to run condor_history within python?
Any tip is more than welcome.
Thanks a lot in advance.
# condor_history -format "%s \n" ClusterId -constraint 'MY_OWN_CLASSAD
== "value"' -match 4
Help on method history:
history(...) unbound htcondor.Schedd method
history( (Schedd)arg1, (object)arg2, (list)arg3, (int)arg4) ->
Request records from schedd's history
:param requirements: Either a ExprTree or a string that can be
parsed as an expression; requirements all returned jobs should match.
:param projection: The attributes to return; an empty list
signifies all attributes.
:param match: Number of matches to return.
:return: An iterator for the matching job ads
>>> import htcondor
>>> schedd = htcondor.Schedd()
>>> out = schedd.history("-constraint 'MY_OWN_CLASSADD == \"value\"'", ['ClusterId'], 4)
>>> fd = os.popen("condor_history -l -constraint 'MY_OWN_CLASSAD == \"value\"' -match 4")
>>> ads = classad.parseOldAds(fd)
>>> print [ad["ClusterId"] for ad in ads]