Commit 700545ab authored by Kostas Papadimitriou's avatar Kostas Papadimitriou Committed by Christos Stavrakakis

Fix handling of firewallProfile action

Refs #3097
parent 7bdec18f
......@@ -448,6 +448,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")
......@@ -457,7 +460,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)
......@@ -474,7 +477,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