Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Yusei Tahara
slapos
Commits
b15133b4
Commit
b15133b4
authored
Dec 22, 2011
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix slave instance use
parent
a8e0a6a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
slapos/recipe/kvm_frontend/__init__.py
slapos/recipe/kvm_frontend/__init__.py
+6
-8
No files found.
slapos/recipe/kvm_frontend/__init__.py
View file @
b15133b4
...
...
@@ -67,18 +67,17 @@ class Recipe(BaseSlapRecipe):
# Get all slaves, add them to config
slave_instance_list
=
self
.
parameter_dict
.
get
(
'slave_instance_list'
,
[])
rewrite_rule_list
=
[]
slave_dict
=
{}
slave_dict
=
dict
()
base_url
=
'https://%s:%s/'
%
(
frontend_domain_name
,
frontend_port_number
)
for
slave_instance
in
slave_instance_list
:
current_slave_dict
=
dict
()
current_slave_dict
[
'host'
]
=
slave_instance
.
getConnectionParameter
(
'host'
)
current_slave_dict
[
'port'
]
=
slave_instance
.
getConnectionParameter
(
'port'
)
current_slave_dict
[
'host'
]
=
slave_instance
[
'host'
]
current_slave_dict
[
'port'
]
=
slave_instance
[
'port'
]
if
current_slave_dict
[
'host'
]
is
None
\
or
current_slave_dict
[
'port'
]
is
None
:
continue
# Is target https or http?
current_slave_dict
[
'https'
]
=
slave_instance
.
getConnectionParameter
(
'https'
,
'true'
)
current_slave_dict
[
'https'
]
=
slave_instance
.
get
(
'https'
,
'true'
)
if
current_slave_dict
[
'https'
]
in
FALSE_VALUE_LIST
:
current_slave_dict
[
'https'
]
=
'false'
...
...
@@ -114,9 +113,7 @@ class Recipe(BaseSlapRecipe):
dict
(
site_url
=
node_parameter_dict
[
'site_url'
],
domain_ipv6_address
=
self
.
getGlobalIPv6Address
()))
# Send connection parameters of slave instances
for
slave_instance
in
slave_dict
.
iteritems
():
slave_site_url
=
'%s%s'
%
(
node_parameter_dict
[
'site_url'
],
slave_instance
.
get
(
'reference'
))
for
slave_reference
,
slave_site_url
in
slave_dict
.
iteritems
():
self
.
setConnectionDict
(
dict
(
site_url
=
slave_site_url
,
domainname
=
frontend_domain_name
,
...
...
@@ -282,6 +279,7 @@ class Recipe(BaseSlapRecipe):
# Install script
kvm_proxy_script_in
=
open
(
self
.
getTemplateFilename
(
'kvm-proxy.js'
),
'r'
).
read
()
# XXX-Cedric : this is NOT a wrapper.
kvm_proxy_script
=
self
.
createRunningWrapper
(
"kvm-proxy.js"
,
kvm_proxy_script_in
)
self
.
path_list
.
append
(
kvm_proxy_script
)
...
...
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