Commit a424ce50 authored by Alexander Schreiber's avatar Alexander Schreiber
Browse files

Correctly filter out Domain-0 from domain list if requested.

Reviewed-by: ultrotter
parent 455a3445
......@@ -170,12 +170,8 @@ class XenHypervisor(BaseHypervisor):
raise HypervisorError("xm list failed, retries exceeded (%s): %s" %
(result.fail_reason, result.stderr))
# skip over the heading and the domain 0 line (optional)
if include_node:
to_skip = 1
to_skip = 2
lines = result.stdout.splitlines()[to_skip:]
# skip over the heading
lines = result.stdout.splitlines()[1:]
result = []
for line in lines:
# The format of lines is:
......@@ -192,7 +188,11 @@ class XenHypervisor(BaseHypervisor):
except ValueError, err:
raise HypervisorError("Can't parse output of xm list,"
" line: %s, error: %s" % (line, err))
# skip the Domain-0 (optional)
if include_node or data[0] != 'Domain-0':
return result
def ListInstances(self):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment