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
8ac8898f
Commit
8ac8898f
authored
Nov 29, 2013
by
Buildbot
Browse files
Fix expected response codes for port lib calls
parent
d19b7ee3
Changes
2
Hide whitespace changes
Inline
Side-by-side
kamaki/clients/cyclades/__init__.py
View file @
8ac8898f
...
...
@@ -251,7 +251,7 @@ class CycladesNetworkClient(NetworkClient):
'Invalid format for "fixed_ips"'
,
details
=
[
'fixed_ips format: [{"ip_address": IPv4}, ...]'
])
port
[
'fixed_ips'
]
=
fixed_ips
r
=
self
.
ports_post
(
json_data
=
dict
(
port
=
port
),
success
=
20
1
)
r
=
self
.
ports_post
(
json_data
=
dict
(
port
=
port
),
success
=
20
0
)
return
r
.
json
[
'port'
]
def
create_floatingip
(
self
,
floating_network_id
,
floating_ip_address
=
''
):
...
...
kamaki/clients/network/__init__.py
View file @
8ac8898f
...
...
@@ -180,7 +180,7 @@ class NetworkClient(NetworkRestClient, Waiter):
return
r
.
json
[
'subnets'
]
def
get_subnet_details
(
self
,
subnet_id
):
r
=
self
.
subnets_get
(
subnet_id
,
success
=
20
1
)
r
=
self
.
subnets_get
(
subnet_id
,
success
=
20
0
)
return
r
.
json
def
update_subnet
(
...
...
@@ -250,7 +250,7 @@ class NetworkClient(NetworkRestClient, Waiter):
port
[
'fixed_ips'
]
=
fixed_ips
if
security_groups
:
port
[
'security_groups'
]
=
security_groups
r
=
self
.
ports_post
(
json_data
=
dict
(
port
=
port
),
success
=
20
1
)
r
=
self
.
ports_post
(
json_data
=
dict
(
port
=
port
),
success
=
20
0
)
return
r
.
json
[
'port'
]
def
create_ports
(
self
,
ports
):
...
...
@@ -280,11 +280,11 @@ class NetworkClient(NetworkRestClient, Waiter):
assert
port
.
get
(
'network_id'
,
None
),
msg
except
AssertionError
as
ae
:
raise
ValueError
(
'%s'
%
ae
)
r
=
self
.
ports_post
(
json_data
=
dict
(
ports
=
list
(
ports
)),
success
=
20
1
)
r
=
self
.
ports_post
(
json_data
=
dict
(
ports
=
list
(
ports
)),
success
=
20
0
)
return
r
.
json
[
'ports'
]
def
get_port_details
(
self
,
port_id
):
r
=
self
.
ports_get
(
port_id
,
success
=
20
1
)
r
=
self
.
ports_get
(
port_id
,
success
=
20
0
)
return
r
.
json
[
'port'
]
def
delete_port
(
self
,
port_id
):
...
...
@@ -318,7 +318,7 @@ class NetworkClient(NetworkRestClient, Waiter):
port
[
'fixed_ips'
]
=
fixed_ips
if
security_groups
:
port
[
'security_groups'
]
=
security_groups
r
=
self
.
ports_put
(
port_id
,
json_data
=
dict
(
port
=
port
),
success
=
20
1
)
r
=
self
.
ports_put
(
port_id
,
json_data
=
dict
(
port
=
port
),
success
=
20
0
)
return
r
.
json
[
'port'
]
def
list_floatingips
(
self
):
...
...
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