def do_job_download(client, args): freezer_utils.create_dir(args.jobs_dir, do_log=True) for doc in _job_list(client, args): fname = os.path.normpath('{0}/job_{1}.conf'.format( args.jobs_dir, doc['job_id'])) try: utils.save_doc_to_json_file(doc, fname) except Exception: print("Unable to write to file {0}".format(fname))
def do_job_download(client, args): create_dir(args.jobs_dir, do_log=True) for doc in _job_list(client, args): fname = os.path.normpath('{0}/job_{1}.conf'. format(args.jobs_dir, doc['job_id'])) try: utils.save_doc_to_json_file(doc, fname) except: print("Unable to write to file {0}".format(fname))
def do_session_get(client, args): """ gets a specific session object and saves it to file. If file is not specified the session obj is printed. :return: None """ if not args.session_id: raise Exception("Parameter --session required") session_doc = client.sessions.get(args.session_id) if args.fname: utils.save_doc_to_json_file(session_doc, args.fname) else: pprint(session_doc)