Exemplo n.º 1
0
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))
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
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)
Exemplo n.º 5
0
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)