Fix xm uptime
PATCH 1/1 Fix xm uptime
Hi,
I saw the following error messages.
# xm uptime Name ID Uptime Unexpected error: exceptions.KeyError
Please report to [email protected] Traceback (most recent call last):
File "/usr/sbin/xm", line 10, in ?
main.main(sys.argv)
File "//usr/lib/python/xen/xm/main.py", line 1436, in main
rc = cmd(args)
File "//usr/lib/python/xen/xm/main.py", line 978, in xm_uptime
if d['dom'] > 0:
KeyError: 'dom'
This patch fixes it.
Signed-off-by Masaki Kanno <[email protected]>
Best regards,
Kan
tools/python/xen/xm/main.py +3 -3
@@ -979,7 +979,7 @@ def xm_uptime(args): for dom in doms: d = parse_doms_info(dom) - if d['dom'] > 0: + if d['domid'] > 0: uptime = int(round(d['up_time'])) else: f=open('/proc/uptime', 'r')
@@ -1006,10 +1006,10 @@ def xm_uptime(args): if short_mode: now = datetime.datetime.now() upstring = now.strftime(" %H:%M:%S") + " up " + upstring - upstring += ", " + d['name'] + " (" + str(d['dom']) + ")" + upstring += ", " + d['name'] + " (" + str(d['domid']) + ")" else: upstring += ':%(seconds)02d' % vars() - upstring = ("%(name)-32s %(dom)3d " % d) + upstring + upstring = ("%(name)-32s %(domid)3d " % d) + upstring print upstring
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel