Revision 8d5795b4 snf-cyclades-app/synnefo/logic/servers.py

b/snf-cyclades-app/synnefo/logic/servers.py
35 35
    if pending_action:
36 36
        if pending_action == "BUILD":
37 37
            raise faults.BuildInProgress("Server '%s' is being build." % vm.id)
38
        raise faults.BadRequest("Can not perform '%s' action while there is a"
38
        raise faults.BadRequest("Cannot perform '%s' action while there is a"
39 39
                                " pending '%s'." % (action, pending_action))
40 40

  
41 41
    # Check if action can be performed to VM's operstate
42 42
    operstate = vm.operstate
43 43
    if operstate == "ERROR":
44
        raise faults.BadRequest("Can not perform '%s' action while server is"
44
        raise faults.BadRequest("Cannot perform '%s' action while server is"
45 45
                                " in 'ERROR' state." % action)
46 46
    elif operstate == "BUILD" and action != "BUILD":
47 47
        raise faults.BuildInProgress("Server '%s' is being build." % vm.id)
......
50 50
         (action == "RESIZE" and operstate != "STOPPED") or\
51 51
         (action in ["CONNECT", "DISCONNECT"] and operstate != "STOPPED"
52 52
          and not settings.GANETI_USE_HOTPLUG):
53
        raise faults.BadRequest("Can not perform '%s' action while server is"
53
        raise faults.BadRequest("Cannot perform '%s' action while server is"
54 54
                                " in '%s' state." % (action, operstate))
55 55
    return
56 56

  
......
275 275
        return None
276 276
    # Check that resize can be performed
277 277
    if old_flavor.disk != flavor.disk:
278
        raise faults.BadRequest("Can not resize instance disk.")
278
        raise faults.BadRequest("Cannot resize instance disk.")
279 279
    if old_flavor.disk_template != flavor.disk_template:
280
        raise faults.BadRequest("Can not change instance disk template.")
280
        raise faults.BadRequest("Cannot change instance disk template.")
281 281

  
282 282
    log.info("Resizing VM from flavor '%s' to '%s", old_flavor, flavor)
283 283
    commission_info = {"cyclades.cpu": flavor.cpu - old_flavor.cpu,
......
401 401

  
402 402
    """
403 403
    if network.state != "ACTIVE":
404
        raise faults.BuildInProgress("Can not create port while network is in"
404
        raise faults.BuildInProgress("Cannot create port while network is in"
405 405
                                     " state %s" % network.state)
406 406
    if network.action == "DESTROY":
407
        msg = "Can not create port. Network %s is being deleted."
407
        msg = "Cannot create port. Network %s is being deleted."
408 408
        raise faults.Conflict(msg % network.id)
409 409
    ipaddress = None
410 410
    if use_ipaddress is not None:
......
493 493

  
494 494
    if port.network.public and not port.ips.filter(floating_ip=True,
495 495
                                                   deleted=False).exists():
496
        raise faults.Forbidden("Can not disconnect from public network.")
496
        raise faults.Forbidden("Cannot disconnect from public network.")
497 497

  
498 498
    if port.machine is not None:
499 499
        vm = disconnect(port.machine, port)

Also available in: Unified diff