Revision 7421d45e

b/snf-cyclades-app/synnefo/api/floating_ips.py
157 157
        network = util.get_network(network_id, userid, for_update=True,
158 158
                                   non_deleted=True)
159 159
        if not network.floating_ip_pool:
160
            # TODO: Maybe 409 ??
161
            # Check that it is a floating IP pool
162
            raise faults.ItemNotFound("Floating IP pool %s does not exist." %
163
                                      network_id)
160
            msg = ("Can not allocate floating IP from network %s. Network is"
161
                   " not a floating IP pool." % network)
162
            raise faults.Conflict(msg)
164 163

  
165 164
        address = api.utils.get_attribute(floating_ip_dict,
166 165
                                          "floating_ip_address",
b/snf-cyclades-app/synnefo/api/networks.py
173 173
        d['external_router'] = network.external_router
174 174
        d['admin_state_up'] = True
175 175
        d['subnets'] = list(network.subnets.values_list('id', flat=True))
176
        d['SNF:floating_ip_pool'] = network.floating_ip_pool
176 177
    return d
177 178

  
178 179

  
b/snf-cyclades-app/synnefo/api/tests/floating_ips.py
163 163
            'floating_network_id': pool2.id}
164 164
            }
165 165
        response = self.post(URL, "test_user", json.dumps(request), "json")
166
        self.assertEqual(response.status_code, 404)
166
        self.assertConflict(response)
167 167

  
168 168
        # Full network
169 169
        net = mf.NetworkWithSubnetFactory(floating_ip_pool=True,

Also available in: Unified diff