Revision 35ea7f67 snf-cyclades-app/synnefo/logic/subnets.py
b/snf-cyclades-app/synnefo/logic/subnets.py | ||
---|---|---|
82 | 82 |
network_id and the desired cidr are mandatory, everything else is optional |
83 | 83 |
|
84 | 84 |
""" |
85 |
|
|
85 | 86 |
try: |
87 |
network_id = int(network_id) |
|
86 | 88 |
network = Network.objects.get(id=network_id) |
89 |
except (ValueError, TypeError): |
|
90 |
raise api.faults.BadRequest("Malformed network ID") |
|
87 | 91 |
except Network.DoesNotExist: |
88 |
raise api.faults.ItemNotFound("No network found with that id")
|
|
92 |
raise api.faults.ItemNotFound("No network found with that ID")
|
|
89 | 93 |
|
90 | 94 |
if network.deleted: |
91 | 95 |
raise api.faults.BadRequest("Network has been deleted") |
Also available in: Unified diff