ia64/xen-unstable

changeset 15852:7dba4441bf92

xend: Fix error message for xm trigger command.

When I tested xm trigger command with a wrong argument, I saw the
following error message.

# xm trigger vm1 xyz
Error: __init__() takes exactly 2 arguments (3 given)
Usage: xm trigger <Domain> <nmi|reset|init> [<VCPU>]

Send a trigger to a domain.

This patch fixes the error message as follows.

# xm trigger vm1 xyz
Error: Invalid trigger: xyz
Usage: xm trigger <Domain> <nmi|reset|init> [<VCPU>]

Send a trigger to a domain.

The type of "TRIGGER_TYPE" is dictionary. domain_send_trigger()
refers to the keys of "TRIGGER_TYPE" without using keys() currently.
This patch adds keys() there.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author kfraser@localhost.localdomain
date Fri Sep 07 11:24:28 2007 +0100 (2007-09-07)
parents f2bc66154ba9
children 0c14d0bf369e
files tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Fri Sep 07 11:10:32 2007 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Fri Sep 07 11:24:28 2007 +0100
     1.3 @@ -1594,10 +1594,10 @@ class XendDomain:
     1.4              raise VMBadState("Domain '%s' is not started" % domid,
     1.5                               POWER_STATE_NAMES[DOM_STATE_RUNNING],
     1.6                               POWER_STATE_NAMES[dominfo._stateGet()])
     1.7 -        if trigger_name.lower() in TRIGGER_TYPE: 
     1.8 +        if trigger_name.lower() in TRIGGER_TYPE.keys(): 
     1.9              trigger = TRIGGER_TYPE[trigger_name.lower()]
    1.10          else:
    1.11 -            raise XendError("Invalid trigger: %s", trigger_name)
    1.12 +            raise XendError("Invalid trigger: %s" % trigger_name)
    1.13          try:
    1.14              return xc.domain_send_trigger(dominfo.getDomid(),
    1.15                                            trigger,