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
e8ba3e9f
Commit
e8ba3e9f
authored
Nov 29, 2013
by
Stavros Sachtouris
Browse files
Re-fix expected codes in network-libs (sorry)
parent
8ac8898f
Changes
3
Hide whitespace changes
Inline
Side-by-side
kamaki/cli/command_shell.py
View file @
e8ba3e9f
...
@@ -175,6 +175,8 @@ class Shell(Cmd):
...
@@ -175,6 +175,8 @@ class Shell(Cmd):
tmp_args
.
pop
(
'verbose'
,
None
)
tmp_args
.
pop
(
'verbose'
,
None
)
tmp_args
.
pop
(
'silent'
,
None
)
tmp_args
.
pop
(
'silent'
,
None
)
tmp_args
.
pop
(
'config'
,
None
)
tmp_args
.
pop
(
'config'
,
None
)
print
'YOLO >>>
\n\t
'
,
'
\n\t
'
.
join
([
(
'%s %s %s'
%
k
,
v
,
v
.
value
)
for
k
,
v
in
args
.
items
()])
help_parser
=
ArgumentParseManager
(
help_parser
=
ArgumentParseManager
(
cmd_name
,
tmp_args
,
required
,
syntax
=
syntax
,
description
=
descr
)
cmd_name
,
tmp_args
,
required
,
syntax
=
syntax
,
description
=
descr
)
return
help_parser
.
print_help
return
help_parser
.
print_help
...
...
kamaki/clients/cyclades/__init__.py
View file @
e8ba3e9f
...
@@ -251,7 +251,7 @@ class CycladesNetworkClient(NetworkClient):
...
@@ -251,7 +251,7 @@ class CycladesNetworkClient(NetworkClient):
'Invalid format for "fixed_ips"'
,
details
=
[
'Invalid format for "fixed_ips"'
,
details
=
[
'fixed_ips format: [{"ip_address": IPv4}, ...]'
])
'fixed_ips format: [{"ip_address": IPv4}, ...]'
])
port
[
'fixed_ips'
]
=
fixed_ips
port
[
'fixed_ips'
]
=
fixed_ips
r
=
self
.
ports_post
(
json_data
=
dict
(
port
=
port
),
success
=
20
0
)
r
=
self
.
ports_post
(
json_data
=
dict
(
port
=
port
),
success
=
20
1
)
return
r
.
json
[
'port'
]
return
r
.
json
[
'port'
]
def
create_floatingip
(
self
,
floating_network_id
,
floating_ip_address
=
''
):
def
create_floatingip
(
self
,
floating_network_id
,
floating_ip_address
=
''
):
...
...
kamaki/clients/network/__init__.py
View file @
e8ba3e9f
...
@@ -180,7 +180,7 @@ class NetworkClient(NetworkRestClient, Waiter):
...
@@ -180,7 +180,7 @@ class NetworkClient(NetworkRestClient, Waiter):
return
r
.
json
[
'subnets'
]
return
r
.
json
[
'subnets'
]
def
get_subnet_details
(
self
,
subnet_id
):
def
get_subnet_details
(
self
,
subnet_id
):
r
=
self
.
subnets_get
(
subnet_id
,
success
=
20
0
)
r
=
self
.
subnets_get
(
subnet_id
,
success
=
20
1
)
return
r
.
json
return
r
.
json
def
update_subnet
(
def
update_subnet
(
...
@@ -250,7 +250,7 @@ class NetworkClient(NetworkRestClient, Waiter):
...
@@ -250,7 +250,7 @@ class NetworkClient(NetworkRestClient, Waiter):
port
[
'fixed_ips'
]
=
fixed_ips
port
[
'fixed_ips'
]
=
fixed_ips
if
security_groups
:
if
security_groups
:
port
[
'security_groups'
]
=
security_groups
port
[
'security_groups'
]
=
security_groups
r
=
self
.
ports_post
(
json_data
=
dict
(
port
=
port
),
success
=
20
0
)
r
=
self
.
ports_post
(
json_data
=
dict
(
port
=
port
),
success
=
20
1
)
return
r
.
json
[
'port'
]
return
r
.
json
[
'port'
]
def
create_ports
(
self
,
ports
):
def
create_ports
(
self
,
ports
):
...
@@ -280,7 +280,7 @@ class NetworkClient(NetworkRestClient, Waiter):
...
@@ -280,7 +280,7 @@ class NetworkClient(NetworkRestClient, Waiter):
assert
port
.
get
(
'network_id'
,
None
),
msg
assert
port
.
get
(
'network_id'
,
None
),
msg
except
AssertionError
as
ae
:
except
AssertionError
as
ae
:
raise
ValueError
(
'%s'
%
ae
)
raise
ValueError
(
'%s'
%
ae
)
r
=
self
.
ports_post
(
json_data
=
dict
(
ports
=
list
(
ports
)),
success
=
20
0
)
r
=
self
.
ports_post
(
json_data
=
dict
(
ports
=
list
(
ports
)),
success
=
20
1
)
return
r
.
json
[
'ports'
]
return
r
.
json
[
'ports'
]
def
get_port_details
(
self
,
port_id
):
def
get_port_details
(
self
,
port_id
):
...
...
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