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@xensource.com>
This commit is contained in:
emellor@leeni.uk.xensource.com committed 2005-11-27 01:01:42 +00:00
1 parent 90094c1bd4
commit cbdece93b2
1 file changed
+6 -13
+6 -13
View File
@@ -47,20 +47,13 @@ class XmError(Exception):
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 isDomainRunning(domain):
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();
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.