"FormatError", "SplitNodeOption", "SubmitOrSend",
"JobSubmittedException", "FormatTimestamp", "ParseTimespec",
"ValidateBeParams", "ToStderr", "ToStdout", "UsesRPC",
- "GetOnlineNodes", "JobExecutor",
+ "GetOnlineNodes", "JobExecutor", "SYNC_OPT",
]
help="Submit the job and return the job ID, but"
" don't wait for the job to finish")
+SYNC_OPT = make_option("--sync", dest="do_locking",
+ default=False, action="store_true",
+ help="Grab locks while doing the queries"
+ " in order to ensure more consistent results")
+
def ARGS_FIXED(val):
"""Macro-like function denoting a fixed number of arguments"""
if cl is None:
cl = GetClient()
- op = opcodes.OpQueryNodes(output_fields=["name", "offline"],
- names=nodes)
- result = SubmitOpCode(op, cl=cl)
+ result = cl.QueryNodes(names=nodes, fields=["name", "offline"],
+ use_locking=False)
offline = [row[0] for row in result if row[1]]
if offline and not nowarn:
ToStderr("Note: skipping offline node(s): %s" % ", ".join(offline))