Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
0864c45d
Commit
0864c45d
authored
Oct 16, 2013
by
Dionysis Grigoropoulos
Browse files
cyclades: s/slac/enable_slac in api/subnets.py
parent
3820e374
Changes
2
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-app/synnefo/api/subnets.py
View file @
0864c45d
...
...
@@ -129,9 +129,9 @@ def create_subnet(request):
if
ipversion
==
6
:
networks
.
validate_network_params
(
None
,
None
,
cidr
,
gateway
)
slac
=
subnet
.
get
(
'slac'
,
None
)
slac
=
subnet
.
get
(
'
enable_
slac'
,
None
)
if
slac
is
not
None
:
dhcp
=
check_boolean_value
(
slac
,
"slac"
)
dhcp
=
check_boolean_value
(
slac
,
"
enable_
slac"
)
else
:
dhcp
=
check_boolean_value
(
subnet
.
get
(
'enable_dhcp'
,
True
),
"dhcp"
)
else
:
...
...
@@ -278,7 +278,7 @@ def subnet_to_dict(subnet):
'allocation_pools'
:
pools
if
pools
is
not
None
else
[]})
if
subnet
.
ipversion
==
6
:
dictionary
[
'slac'
]
=
subnet
.
dhcp
dictionary
[
'
enable_
slac'
]
=
subnet
.
dhcp
return
dictionary
...
...
snf-cyclades-app/synnefo/api/tests/subnets.py
View file @
0864c45d
...
...
@@ -100,7 +100,7 @@ class SubnetTest(BaseAPITest):
'network_id'
:
test_net
.
id
,
'cidr'
:
'10.0.3.0/24'
,
'ip_version'
:
4
,
'slac'
:
False
}
'
enable_
slac'
:
False
}
}
response
=
self
.
post
(
SUBNETS_URL
,
test_net
.
userid
,
json
.
dumps
(
request
),
"json"
)
...
...
@@ -114,7 +114,7 @@ class SubnetTest(BaseAPITest):
'network_id'
:
test_net
.
id
,
'cidr'
:
'fdc1:4992:1130:fc0b::/64'
,
'ip_version'
:
6
,
'slac'
:
False
}
'
enable_
slac'
:
False
}
}
response
=
self
.
post
(
SUBNETS_URL
,
test_net
.
userid
,
json
.
dumps
(
request
),
"json"
)
...
...
@@ -128,7 +128,7 @@ class SubnetTest(BaseAPITest):
'network_id'
:
test_net
.
id
,
'cidr'
:
'fdc1:4992:1130:fc0b::/64'
,
'ip_version'
:
6
,
'slac'
:
'Random'
}
'
enable_
slac'
:
'Random'
}
}
response
=
self
.
post
(
SUBNETS_URL
,
test_net
.
userid
,
json
.
dumps
(
request
),
"json"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment