Revision b7f21824 snf-cyclades-app/synnefo/api/servers.py

b/snf-cyclades-app/synnefo/api/servers.py
448 448
    req = util.get_request_dict(request)
449 449
    log.debug('server_action %s %s', server_id, req)
450 450

  
451
    # additional server actions
452
    ARBITRARY_ACTIONS = ['console', 'firewallProfile']
453

  
451 454
    if len(req) != 1:
452 455
        raise faults.BadRequest("Malformed request")
453 456

  
......
457 460

  
458 461
    try:
459 462
        key = req.keys()[0]
460
        if key != 'console':
463
        if key not in ARBITRARY_ACTIONS:
461 464
            start_action(vm, key_to_action(key))
462 465
        val = req[key]
463 466
        assert isinstance(val, dict)
......
474 477
        return "STOP"
475 478
    if key == "delete":
476 479
        return "DESTROY"
477
    if key == "console":
480
    if key in ARBITRARY_ACTIONS:
478 481
        return None
479 482
    else:
480 483
        return key.upper()

Also available in: Unified diff