[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Remove looping from handling of xm domid. This command should now work first
# HG changeset patch # User emellor@xxxxxxxxxxxxxxxxxxxxxx # Node ID 86a2e2645e40bb311600159062051369963c930c # Parent 4f12ed3342dc105b0238a36352f35385dce86ff2 Remove looping from handling of xm domid. This command should now work first time after creation of a domain. Have the getRunningDomains method detect failure of the xm list command, as indicated by the error code. Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx> diff -r 4f12ed3342dc -r 86a2e2645e40 tools/xm-test/lib/XmTestLib/Xm.py --- a/tools/xm-test/lib/XmTestLib/Xm.py Sun Nov 27 00:59:37 2005 +++ b/tools/xm-test/lib/XmTestLib/Xm.py Sun Nov 27 01:01:42 2005 @@ -47,20 +47,13 @@ def domid(name): status, output = traceCommand("xm domid " + name); - if re.search("Traceback", output): - print "*** xm domid failed with:" - print output - for i in range(0,10): - status, output = traceCommand("xm list") - status, output = traceCommand("xm domid " + name); - if not re.search("Traceback", output): - break - + if status != 0 or "Traceback" in output: + return -1 try: - id = int(output); + return int(output) except: - id = -1; - return id; + raise XmError("xm domid failed", trace=output, status=status) + def domname(id): status, output = traceCommand("xm domname " + str(id)); @@ -75,7 +68,7 @@ def getRunningDomains(): status, output = traceCommand("xm list"); - if "Traceback" in output: + if status != 0 or "Traceback" in output: raise XmError("xm failed", trace=output, status=status) lines = output.splitlines(); _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |