Commit b3d25c78 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou

Fix handling of firewallProfile action

Refs #3097
parent 02e344ac
......@@ -454,6 +454,9 @@ def server_action(request, server_id):
req = util.get_request_dict(request)
log.debug('server_action %s %s', server_id, req)
# additional server actions
ARBITRARY_ACTIONS = ['console', 'firewallProfile']
if len(req) != 1:
raise faults.BadRequest("Malformed request")
......@@ -463,7 +466,7 @@ def server_action(request, server_id):
try:
key = req.keys()[0]
if key != 'console':
if key not in ARBITRARY_ACTIONS:
start_action(vm, key_to_action(key))
val = req[key]
assert isinstance(val, dict)
......@@ -480,7 +483,7 @@ def key_to_action(key):
return "STOP"
if key == "delete":
return "DESTROY"
if key == "console":
if key in ARBITRARY_ACTIONS:
return None
else:
return key.upper()
......
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