コード例 #1
0
ファイル: JobCmds.py プロジェクト: utsdab/usr
 def processObject(self, obj):
     """Operate on the provided job object."""
     # ask the user if we should continue
     if not obj.pre(self, "Lock this job?"):
         return
     # try to run the operation
     query.lock(obj, note=self.opts.note)
     obj.post(self, "locked")
コード例 #2
0
ファイル: test.py プロジェクト: utsdab/usr
def test_job_ops(job):
    print "chcrews"
    tq.chcrews(job, crews=["newcrew1", "newcrew2"])
    print "chpri"
    tq.chpri(job, priority=123)
    print "jattr"
    tq.jattr(job, key="comment", value="new comment")
    print "pause"
    tq.pause(job)
    print "unpause"
    tq.unpause(job)
    print "lock"
    tq.lock(job)
    print "unlock"
    tq.unlock(job)
    print "interrupt"
    try:
        tq.interrupt(job)
    except EngineClient.TransactionError, err:
        print "received exception for interrupting job - we should fix that"