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
kamaki
Commits
f6f81cd3
Commit
f6f81cd3
authored
Apr 15, 2013
by
Stavros Sachtouris
Browse files
Set a default network type when creating nets
Default type is MAX_FILTERED Support #3514
parent
7515b22e
Changes
3
Hide whitespace changes
Inline
Side-by-side
kamaki/cli/commands/cyclades.py
View file @
f6f81cd3
...
...
@@ -596,7 +596,11 @@ class network_create(_init_cyclades):
cidr
=
ValueArgument
(
'explicitly set cidr'
,
'--with-cidr'
),
gateway
=
ValueArgument
(
'explicitly set gateway'
,
'--with-gateway'
),
dhcp
=
FlagArgument
(
'Use dhcp (default: off)'
,
'--with-dhcp'
),
type
=
ValueArgument
(
'explicitly set type'
,
'--with-type'
)
type
=
ValueArgument
(
'Valid network types are '
'CUSTOM, IP_LESS_ROUTED, MAC_FILTERED (default), PHYSICAL_VLAN'
,
'--with-type'
,
default
=
'MAC_FILTERED'
)
)
@
errors
.
generic
.
all
...
...
kamaki/clients/cyclades/__init__.py
View file @
f6f81cd3
...
...
@@ -152,7 +152,8 @@ class CycladesClient(CycladesRestClient):
:param geteway: (str)
:param type: (str)
:param type: (str) if None, will use MAC_FILTERED as default
Valid values: CUSTOM, IP_LESS_ROUTED, MAC_FILTERED, PHYSICAL_VLAN
:param dhcp: (bool)
...
...
@@ -163,8 +164,7 @@ class CycladesClient(CycladesRestClient):
net
[
'cidr'
]
=
cidr
if
gateway
:
net
[
'gateway'
]
=
gateway
if
type
:
net
[
'type'
]
=
type
net
[
'type'
]
=
type
or
'MAC_FILTERED'
net
[
'dhcp'
]
=
True
if
dhcp
else
False
req
=
dict
(
network
=
net
)
r
=
self
.
networks_post
(
json_data
=
req
,
success
=
202
)
...
...
kamaki/clients/cyclades/test.py
View file @
f6f81cd3
...
...
@@ -311,7 +311,7 @@ class CycladesClient(TestCase):
dhcp
=
True
)
test_args
=
dict
(
full_args
)
test_args
.
update
(
dict
(
empty
=
None
,
full
=
None
))
net_exp
=
dict
(
dhcp
=
False
,
name
=
net_name
)
net_exp
=
dict
(
dhcp
=
False
,
name
=
net_name
,
type
=
'MAC_FILTERED'
)
for
arg
,
val
in
test_args
.
items
():
kwargs
=
{}
if
arg
==
'empty'
else
full_args
if
(
arg
==
'full'
)
else
{
arg
:
val
}
...
...
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