Revision a424ce50
b/lib/hypervisor.py | ||
---|---|---|
170 | 170 |
raise HypervisorError("xm list failed, retries exceeded (%s): %s" % |
171 | 171 |
(result.fail_reason, result.stderr)) |
172 | 172 |
|
173 |
# skip over the heading and the domain 0 line (optional) |
|
174 |
if include_node: |
|
175 |
to_skip = 1 |
|
176 |
else: |
|
177 |
to_skip = 2 |
|
178 |
lines = result.stdout.splitlines()[to_skip:] |
|
173 |
# skip over the heading |
|
174 |
lines = result.stdout.splitlines()[1:] |
|
179 | 175 |
result = [] |
180 | 176 |
for line in lines: |
181 | 177 |
# The format of lines is: |
... | ... | |
192 | 188 |
except ValueError, err: |
193 | 189 |
raise HypervisorError("Can't parse output of xm list," |
194 | 190 |
" line: %s, error: %s" % (line, err)) |
195 |
result.append(data) |
|
191 |
|
|
192 |
# skip the Domain-0 (optional) |
|
193 |
if include_node or data[0] != 'Domain-0': |
|
194 |
result.append(data) |
|
195 |
|
|
196 | 196 |
return result |
197 | 197 |
|
198 | 198 |
def ListInstances(self): |
Also available in: Unified diff