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
Tristan Cavelier
slapos
Commits
f195a63c
Commit
f195a63c
authored
Dec 08, 2011
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kvm frontend : Correctly detect if we want to connect to slave target in plain http
parent
0a687aff
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
slapos/recipe/kvm_frontend/__init__.py
slapos/recipe/kvm_frontend/__init__.py
+12
-8
No files found.
slapos/recipe/kvm_frontend/__init__.py
View file @
f195a63c
...
...
@@ -34,6 +34,7 @@ import zc.recipe.egg
import
ConfigParser
TRUE_VALUE_LIST
=
[
'y'
,
'yes'
,
'1'
,
'true'
]
FALSE_VALUE_LIST
=
[
'n'
,
'no'
,
'0'
,
'false'
]
class
Recipe
(
BaseSlapRecipe
):
...
...
@@ -57,7 +58,11 @@ class Recipe(BaseSlapRecipe):
frontend_port_number
=
self
.
parameter_dict
.
get
(
"port"
,
4443
)
frontend_domain_name
=
self
.
parameter_dict
.
get
(
"domain"
,
"host.vifib.net"
)
redirect_plain_http
=
self
.
parameter_dict
.
get
(
"redirect_plain_http"
,
False
)
# Create http server redirecting (302) to https proxy?
redirect_plain_http
=
self
.
parameter_dict
.
get
(
"redirect_plain_http"
,
''
)
if
redirect_plain_http
in
TRUE_VALUE_LIST
:
redirect_plain_http
=
'1'
# Get all slaves, add them to config
slave_instance_list
=
self
.
parameter_dict
.
get
(
'slave_instance_list'
,
[])
...
...
@@ -71,7 +76,11 @@ class Recipe(BaseSlapRecipe):
if
current_slave_dict
[
'host'
]
is
None
\
or
current_slave_dict
[
'port'
]
is
None
:
continue
current_slave_dict
[
'https'
]
=
slave_instance
.
get
(
'https'
,
False
)
# Is target https or http?
current_slave_dict
[
'https'
]
=
slave_instance
.
get
(
'https'
,
'true'
)
if
current_slave_dict
[
'https'
]
in
FALSE_VALUE_LIST
:
current_slave_dict
[
'https'
]
=
'false'
reference
=
slave_instance
.
get
(
'slave_reference'
)
current_slave_dict
[
'reference'
]
=
reference
slave_dict
[
reference
]
=
"%s%s"
%
(
base_url
,
reference
.
replace
(
'-'
,
''
))
...
...
@@ -268,11 +277,6 @@ class Recipe(BaseSlapRecipe):
kvm_proxy_script_in
)
self
.
path_list
.
append
(
kvm_proxy_script
)
# Create http server?
if
plain_http
in
TRUE_VALUE_LIST
:
plain_http
=
'1'
else
:
plain_http
=
''
# Create wrapper
wrapper
=
zc
.
buildout
.
easy_install
.
scripts
([(
"kvm_frontend"
,
'slapos.recipe.librecipe.execute'
,
'executee_wait'
)],
self
.
ws
,
...
...
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