Revision 8d5795b4 snf-cyclades-app/synnefo/api/networks.py
b/snf-cyclades-app/synnefo/api/networks.py | ||
---|---|---|
112 | 112 |
if flavor not in Network.FLAVORS.keys(): |
113 | 113 |
raise api.faults.BadRequest("Invalid network type '%s'" % flavor) |
114 | 114 |
if flavor not in settings.API_ENABLED_NETWORK_FLAVORS: |
115 |
raise api.faults.Forbidden("Can not create network of type '%s'." %
|
|
115 |
raise api.faults.Forbidden("Cannot create network of type '%s'." % |
|
116 | 116 |
flavor) |
117 | 117 |
|
118 | 118 |
name = api.utils.get_attribute(network_dict, "name", required=False) |
... | ... | |
143 | 143 |
|
144 | 144 |
network = util.get_network(network_id, request.user_uniq, for_update=True) |
145 | 145 |
if network.public: |
146 |
raise api.faults.Forbidden("Can not rename the public network.")
|
|
146 |
raise api.faults.Forbidden("Cannot rename the public network.") |
|
147 | 147 |
network = networks.rename(network, new_name) |
148 | 148 |
return render_network(request, network_to_dict(network), 200) |
149 | 149 |
|
... | ... | |
154 | 154 |
log.info('delete_network %s', network_id) |
155 | 155 |
network = util.get_network(network_id, request.user_uniq, for_update=True) |
156 | 156 |
if network.public: |
157 |
raise api.faults.Forbidden("Can not delete the public network.")
|
|
157 |
raise api.faults.Forbidden("Cannot delete the public network.") |
|
158 | 158 |
networks.delete(network) |
159 | 159 |
return HttpResponse(status=204) |
160 | 160 |
|
Also available in: Unified diff