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
Jean-Paul Smets
slapos
Commits
14b4699b
Commit
14b4699b
authored
Jun 14, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
frontend: better handling of slave errors
Slave errors must NOT stop processing of other slaves
parent
b6e6aab0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
slapos/recipe/apache_frontend/__init__.py
slapos/recipe/apache_frontend/__init__.py
+15
-5
No files found.
slapos/recipe/apache_frontend/__init__.py
View file @
14b4699b
...
...
@@ -33,6 +33,7 @@ import zc.buildout
import
zc.recipe.egg
import
ConfigParser
import
re
import
traceback
class
Recipe
(
BaseSlapRecipe
):
...
...
@@ -78,7 +79,7 @@ class Recipe(BaseSlapRecipe):
# Future work may allow to choose between http and https (or both?)
scheme
=
'http://'
self
.
logger
.
info
(
'
p
rocessing slave instance: %s'
%
reference
)
self
.
logger
.
info
(
'
P
rocessing slave instance: %s'
%
reference
)
# Check for mandatory slave fields
if
backend_url
is
None
:
...
...
@@ -89,10 +90,13 @@ class Recipe(BaseSlapRecipe):
# Check for custom domain (like mypersonaldomain.com)
# If no custom domain, use generated one.
# Note: if we get an empty custom_domain parameter, we ignore it
domain
=
slave_instance
.
get
(
'custom_domain'
).
strip
()
if
domain
is
None
or
domain
==
''
:
domain
=
slave_instance
.
get
(
'custom_domain'
)
if
isinstance
(
domain
,
basestring
):
domain
=
domain
.
strip
()
if
domain
is
None
or
domain
.
strip
()
==
''
:
domain
=
"%s.%s"
%
(
reference
.
replace
(
"-"
,
""
).
lower
(),
frontend_domain_name
)
# Define the URL where the instance will be available
# WARNING: we use default ports (443, 80) here.
slave_dict
[
reference
]
=
"%s%s/"
%
(
scheme
,
domain
)
...
...
@@ -152,7 +156,13 @@ class Recipe(BaseSlapRecipe):
# Send connection informations about each slave
for
reference
,
url
in
slave_dict
.
iteritems
():
self
.
setConnectionDict
(
dict
(
site_url
=
url
),
reference
)
self
.
logger
.
debug
(
"Sending connection parameters of slave "
"instance: %s"
%
reference
)
try
:
self
.
setConnectionDict
(
dict
(
site_url
=
url
),
reference
)
except
:
self
.
logger
.
fatal
(
"Error while sending slave %s informations: %s"
,
reference
,
traceback
.
format_exc
())
# Then set it for master instance
self
.
setConnectionDict
(
...
...
@@ -454,7 +464,7 @@ class Recipe(BaseSlapRecipe):
return
stunnel_conf
def
installFrontendApache
(
self
,
ip_list
,
key
,
certificate
,
name
,
port
=
4443
,
plain_http_port
=
8080
,
port
=
4443
,
plain_http_port
=
8080
,
rewrite_rule_list
=
[],
rewrite_rule_zope_list
=
[],
access_control_string
=
None
):
# Create htdocs, populate it with default 404 document
...
...
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