Exemplo n.º 1
0
 def processObject(self, obj):
     """Operate on the provided job object."""
     # ask the user if we should continue
     if not obj.pre(self, "Unlock this job?"):
         return
     # try to run the operation
     query.unlock(obj)
     obj.post(self, "unlocked")
Exemplo n.º 2
0
Arquivo: test.py Projeto: 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"