Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
0a34870b
Commit
0a34870b
authored
Nov 10, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4858 from sivel/rax-clb-serialize
Fix serialization error in rax_clb
parents
3e6369e0
a897bb38
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
28 deletions
+25
-28
library/cloud/rax_clb
+25
-28
No files found.
library/cloud/rax_clb
View file @
0a34870b
...
@@ -136,6 +136,29 @@ PROTOCOLS = ['DNS_TCP', 'DNS_UDP', 'FTP', 'HTTP', 'HTTPS', 'IMAPS', 'IMAPv4',
...
@@ -136,6 +136,29 @@ PROTOCOLS = ['DNS_TCP', 'DNS_UDP', 'FTP', 'HTTP', 'HTTPS', 'IMAPS', 'IMAPv4',
'TCP_CLIENT_FIRST'
,
'UDP'
,
'UDP_STREAM'
,
'SFTP'
]
'TCP_CLIENT_FIRST'
,
'UDP'
,
'UDP_STREAM'
,
'SFTP'
]
def
to_dict
(
obj
):
instance
=
{}
for
key
in
dir
(
obj
):
value
=
getattr
(
obj
,
key
)
if
key
==
'virtual_ips'
:
instance
[
key
]
=
[]
for
vip
in
value
:
vip_dict
=
{}
for
vip_key
,
vip_value
in
vars
(
vip
)
.
iteritems
():
if
isinstance
(
vip_value
,
NON_CALLABLES
):
vip_dict
[
vip_key
]
=
vip_value
instance
[
key
]
.
append
(
vip_dict
)
elif
key
==
'nodes'
:
instance
[
key
]
=
[]
for
node
in
value
:
instance
[
key
]
.
append
(
node
.
to_dict
())
elif
(
isinstance
(
value
,
NON_CALLABLES
)
and
not
key
.
startswith
(
'_'
)):
instance
[
key
]
=
value
return
instance
def
cloud_load_balancer
(
module
,
state
,
name
,
meta
,
algorithm
,
port
,
protocol
,
def
cloud_load_balancer
(
module
,
state
,
name
,
meta
,
algorithm
,
port
,
protocol
,
vip_type
,
timeout
,
wait
,
wait_timeout
):
vip_type
,
timeout
,
wait
,
wait_timeout
):
for
arg
in
(
state
,
name
,
port
,
protocol
,
vip_type
):
for
arg
in
(
state
,
name
,
port
,
protocol
,
vip_type
):
...
@@ -210,20 +233,7 @@ def cloud_load_balancer(module, state, name, meta, algorithm, port, protocol,
...
@@ -210,20 +233,7 @@ def cloud_load_balancer(module, state, name, meta, algorithm, port, protocol,
pyrax
.
utils
.
wait_for_build
(
balancer
,
interval
=
5
,
attempts
=
attempts
)
pyrax
.
utils
.
wait_for_build
(
balancer
,
interval
=
5
,
attempts
=
attempts
)
balancer
.
get
()
balancer
.
get
()
instance
=
{}
instance
=
to_dict
(
balancer
)
for
key
,
value
in
vars
(
balancer
)
.
iteritems
():
if
key
==
'virtual_ips'
:
virtual_ips
=
[]
instance
[
key
]
=
[]
for
vip
in
value
:
vip_dict
=
{}
for
vip_key
,
vip_value
in
vars
(
vip
)
.
iteritems
():
if
isinstance
(
vip_value
,
NON_CALLABLES
):
vip_dict
[
vip_key
]
=
vip_value
instance
[
key
]
.
append
(
vip_dict
)
elif
(
isinstance
(
value
,
NON_CALLABLES
)
and
not
key
.
startswith
(
'_'
)):
instance
[
key
]
=
value
result
=
dict
(
changed
=
changed
,
balancer
=
instance
)
result
=
dict
(
changed
=
changed
,
balancer
=
instance
)
...
@@ -246,20 +256,7 @@ def cloud_load_balancer(module, state, name, meta, algorithm, port, protocol,
...
@@ -246,20 +256,7 @@ def cloud_load_balancer(module, state, name, meta, algorithm, port, protocol,
except
Exception
,
e
:
except
Exception
,
e
:
module
.
fail_json
(
msg
=
'
%
s'
%
e
.
message
)
module
.
fail_json
(
msg
=
'
%
s'
%
e
.
message
)
instance
=
{}
instance
=
to_dict
(
balancer
)
for
key
,
value
in
vars
(
balancer
)
.
iteritems
():
if
key
==
'virtual_ips'
:
virtual_ips
=
[]
instance
[
key
]
=
[]
for
vip
in
value
:
vip_dict
=
{}
for
vip_key
,
vip_value
in
vars
(
vip
)
.
iteritems
():
if
isinstance
(
vip_value
,
NON_CALLABLES
):
vip_dict
[
vip_key
]
=
vip_value
instance
[
key
]
.
append
(
vip_dict
)
elif
(
isinstance
(
value
,
NON_CALLABLES
)
and
not
key
.
startswith
(
'_'
)):
instance
[
key
]
=
value
if
wait
:
if
wait
:
attempts
=
wait_timeout
/
5
attempts
=
wait_timeout
/
5
...
...
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