Revision b968e8e6 snf-cyclades-app/synnefo/api/ports.py
b/snf-cyclades-app/synnefo/api/ports.py | ||
---|---|---|
114 | 114 |
fip_address = api.utils.get_attribute(fixed_ips[0], 'ip_address', |
115 | 115 |
required=True) |
116 | 116 |
ipaddress = util.get_floating_ip_by_address(user_id, fip_address, |
117 |
for_update=True)
|
|
117 |
for_update=True) |
|
118 | 118 |
if ipaddress.network.id != network.id: |
119 |
raise api.faults.Conflict("The given ip is not on the \
|
|
120 |
given network")
|
|
119 |
raise api.faults.Conflict("Floating IP address %s does not belong"
|
|
120 |
" to network %s." % fip_address, net_id)
|
|
121 | 121 |
|
122 |
vm = util.get_vm(dev_id, user_id, non_deleted=True, non_suspended=True) |
|
122 |
vm = util.get_vm(dev_id, user_id, for_update=True, non_deleted=True, |
|
123 |
non_suspended=True) |
|
123 | 124 |
|
124 | 125 |
name = api.utils.get_attribute(port_dict, "name", required=False) |
125 | 126 |
if name is None: |
Also available in: Unified diff