def get_jobs(): """Print jobs XML""" doc = resources.get_jobs() if doc == None: print "No data returned" return print(etree.tostring(doc, pretty_print=True))
def delete_all(args): """Delete all jobs""" doc = resources.get_jobs() xpath_expr = "//{{{0}}}job/@id".format(settings.PX_NS) xpath_fn = etree.ETXPath(xpath_expr) results = xpath_fn(doc) for r in results: delete_job(r)
def get_jobs(args): """Print jobs XML""" doc = None if args.id: doc = resources.get_job(args.id) else: doc = resources.get_jobs() print_result(doc)