Skip to content
Browse files

Implements Log config cloning.

git-svn-id: svn://cherokee-project.com/wizards2@6799 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information...
1 parent 2d16875 commit 6909a6d343f5d4b364e9bcfff5c9aec670bb9e4a @alobbs alobbs committed Aug 9, 2011
Showing with 31 additions and 7 deletions.
  1. +19 −0 Wizard2.py
  2. +8 −6 Wizard2_GUI.py
  3. +4 −0 templates/PHP.py
  4. +0 −1 wizards/02-Content Management Systems/wordpress.py
View
19 Wizard2.py
@@ -202,6 +202,25 @@ def _Handle_Unpacking (self):
return []
+ def _Handle_Log_VServer (self):
+ # For VServers only
+ if not self.type == 'vserver':
+ return []
+
+ # Log config cloning
+ cp_vserver_log = self.params.get ('cp_vsrv_log')
+ if cp_vserver_log:
+ vsrv_1st = CTK.cfg.get_lowest_entry ('vserver')
+
+ if CTK.cfg['vserver!%s!logger' %(vsrv_1st)]:
+ CTK.cfg.clone ('vserver!%s!logger' %(vsrv_1st), 'vserver!%s!logger' %(self.vserver_num))
+
+ if CTK.cfg['vserver!%s!error_writer'%(vsrv_1st)]:
+ CTK.cfg.clone ('vserver!%s!error_writer' %(vsrv_1st), 'vserver!%s!error_writer' %(self.vserver_num))
+
+ return []
+
+
#
# Checks
#
View
14 Wizard2_GUI.py
@@ -150,11 +150,6 @@ def __build_GUI__ (self):
# Virtual Server Logging
#
-LOGGING_OPTIONS = [
- ('', N_('No logging')),
- ('copy', N_('Copy from default'))
-]
-
class Stage_VServer_Logging (Phase_PrevNext):
class Apply:
def __call__ (self):
@@ -164,8 +159,15 @@ def __init__ (self):
Phase_PrevNext.__init__ (self, _("Logging Configuration"))
def __build_GUI__ (self):
+ vsrv_def = CTK.cfg.get_lowest_entry ('vserver')
+
+ logging_options = [
+ ('', N_('No logging')),
+ (vsrv_def, N_('Copy from default'))
+ ]
+
submit = CTK.Submitter (URL_STAGE_VSERVER_LOGGING_APPLY)
- submit += CTK.RadioGroupCfg ('%s!logging'%(CFG_PREFIX), LOGGING_OPTIONS, {'checked': LOGGING_OPTIONS[0][0]})
+ submit += CTK.RadioGroupCfg ('%s!cp_vsrv_log'%(CFG_PREFIX), logging_options, {'checked': logging_options[0][0]})
box = CTK.Box()
box += submit
View
4 templates/PHP.py
@@ -109,6 +109,10 @@ def Configure_Cherokee (self):
# Normalize rules
CTK.cfg.normalize ('vserver!%s!rule'%(self.vserver_num))
+ # Logging config
+ errors = self._Handle_Log_VServer()
+ if errors: return errors
+
return []
View
1 wizards/02-Content Management Systems/wordpress.py
@@ -115,7 +115,6 @@ def Check_Prerequisites (self):
return errors
def _Handle_Unpacking (self):
- # Unpack
errors = php_tpl.Install._Handle_Unpacking (self)
if errors: return errors

0 comments on commit 6909a6d

Please sign in to comment.
Something went wrong with that request. Please try again.