Revision 97ca522f snf-cyclades-app/synnefo/api/subnets.py
b/snf-cyclades-app/synnefo/api/subnets.py | ||
---|---|---|
129 | 129 |
|
130 | 130 |
if ipversion == 6: |
131 | 131 |
networks.validate_network_params(None, None, cidr, gateway) |
132 |
slac = subnet.get('slac', None) |
|
133 |
if slac is not None: |
|
134 |
dhcp = check_dhcp_value(slac) |
|
135 |
else: |
|
136 |
dhcp = check_dhcp_value(subnet.get('enable_dhcp', True)) |
|
132 | 137 |
else: |
133 | 138 |
networks.validate_network_params(cidr, gateway) |
139 |
dhcp = check_dhcp_value(subnet.get('enable_dhcp', True)) |
|
134 | 140 |
|
135 |
dhcp = check_dhcp_value(subnet.get('enable_dhcp', True)) |
|
136 | 141 |
name = check_name_length(subnet.get('name', None)) |
137 | 142 |
|
138 | 143 |
dns = subnet.get('dns_nameservers', None) |
... | ... | |
275 | 280 |
'dns_nameservers': subnet.dns_nameservers, |
276 | 281 |
'host_routes': subnet.host_routes, |
277 | 282 |
'allocation_pools': []}) |
283 |
|
|
284 |
if subnet.ipversion == 6: |
|
285 |
dictionary['slac'] = subnet.dhcp |
|
286 |
|
|
278 | 287 |
return dictionary |
279 | 288 |
|
280 | 289 |
|
... | ... | |
288 | 297 |
def check_dhcp_value(dhcp): |
289 | 298 |
"""Check if dhcp value is in acceptable values""" |
290 | 299 |
if dhcp not in [True, False]: |
291 |
raise api.faults.BadRequest("Malformed request, enable_dhcp must be "
|
|
292 |
"True or False") |
|
300 |
raise api.faults.BadRequest("Malformed request, enable_dhcp/slac must "
|
|
301 |
"be True or False")
|
|
293 | 302 |
return dhcp |
294 | 303 |
|
295 | 304 |
|
Also available in: Unified diff