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>
This commit is contained in:
kfraser@localhost.localdomain committed 2007-09-07 11:24:28 +01:00
1 parent 95f83e447a
commit 214523659d
1 file changed
+2 -2
+2 -2
View File
@@ -1594,10 +1594,10 @@ class XendDomain:
raise VMBadState("Domain '%s' is not started" % domid,
POWER_STATE_NAMES[DOM_STATE_RUNNING],
POWER_STATE_NAMES[dominfo._stateGet()])
if trigger_name.lower() in TRIGGER_TYPE:
if trigger_name.lower() in TRIGGER_TYPE.keys():
trigger = TRIGGER_TYPE[trigger_name.lower()]
else:
raise XendError("Invalid trigger: %s", trigger_name)
raise XendError("Invalid trigger: %s" % trigger_name)
try:
return xc.domain_send_trigger(dominfo.getDomid(),
trigger,
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.