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

[HTCondor-users] Removed all jobs from a cluster via Python binding



HiÂGuys,
          I need our condor users to be able to remove all of their jobs from a particular cluster by specifying just cluster id.Â

I am using following python codes to achieve this :-Â

ÂIn below codes clusid is the int variableÂthat stores cluster id given by the userÂ

ads = schedd.query(
                constraint=f'ClusterId == {clusid}',  Â
                projection=["ClusterId"],
                )
            for ad in ads:
                clusterId = ad['ClusterId']
                break
            result = schedd.act(htcondor.JobAction.Remove, f'ClusterId == clusterId')
            print(f"Jobs successfully removed: {result['TotalSuccess']}")

But above codes remove all jobs from all clusters instead of all jobs from that particular cluster id.Â

Please let me know what I am missing here.Â

Thanks,
GaganÂ