/usr/share/arc/examples/sdk/job_status.py is in nordugrid-arc-python 5.0.5-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #! /usr/bin/env python
import arc
import sys
import os
def example():
# Creating a UserConfig object with the user's proxy
# and the path of the trusted CA certificates
uc = arc.UserConfig()
uc.ProxyPath("/tmp/x509up_u%s" % os.getuid())
uc.CACertificatesDirectory("/etc/grid-security/certificates")
# Create a new job object with a given JobID
job = arc.Job()
job.JobID = "https://piff.hep.lu.se:443/arex/1QuMDmRwvUfn5h5iWqkutBwoABFKDmABFKDmIpHKDmXBFKDmIuAean"
job.Flavour = "ARC1"
job.JobManagementURL = arc.URL("https://piff.hep.lu.se:443/arex")
job.JobStatusURL = arc.URL("https://piff.hep.lu.se:443/arex")
sys.stdout.write("Job object before update:\n")
job.SaveToStream(arc.CPyOstream(sys.stdout), True)
job_supervisor = arc.JobSupervisor(uc, [job])
# Update the states of jobs within this JobSupervisor
job_supervisor.Update()
# Get our updated job from the JobSupervisor
jobs = job_supervisor.GetAllJobs()
job = jobs[0]
sys.stdout.write("Job object after update:\n")
job.SaveToStream(arc.CPyOstream(sys.stdout), True)
# wait for all the background threads to finish before we destroy the objects they may use
import atexit
@atexit.register
def wait_exit():
arc.ThreadInitializer().waitExit()
# arc.Logger.getRootLogger().addDestination(arc.LogStream(sys.stderr))
# arc.Logger.getRootLogger().setThreshold(arc.DEBUG)
# run the example
example()
|