Fix options for pluto per-peer logging

--perpeerlogbase option has no effect without --perpeerlog. [1]
Moreover there is no need to create 'logs' dir as there is a 'log'
dir that can be reused.

Also fixed indentation issue for enable_detailed_logging option
declaration.

[1] http://linux.die.net/man/8/ipsec_pluto

DocImpact
Related-Bug: #1308730
Change-Id: Ie5ef72c2abd83b9b1114d90a6c7294cc34174018
This commit is contained in:
Elena Ezhova 2015-10-28 17:05:00 +03:00
parent 86296ea7f0
commit ff49617ff7
2 changed files with 7 additions and 7 deletions

View File

@ -22,7 +22,7 @@
# Enable detail logging for ipsec pluto process.
# If the flag set to True, the detailed logging will
# be written into config_base_dir/<pid>/logs."
# be written into config_base_dir/<pid>/log."
# NOTE: this applies to OpenSwan and Libraswan, and
# that StrongSwan has logging that logs to syslog.
# enable_detailed_logging=False

View File

@ -54,10 +54,10 @@ ipsec_opts = [
default=60,
help=_("Interval for checking ipsec status")),
cfg.BoolOpt('enable_detailed_logging',
default=False,
help=_("Enable detail logging for ipsec pluto process. "
"If the flag set to True, the detailed logging will "
"be written into config_base_dir/<pid>/logs.")),
default=False,
help=_("Enable detail logging for ipsec pluto process. "
"If the flag set to True, the detailed logging will "
"be written into config_base_dir/<pid>/log.")),
]
cfg.CONF.register_opts(ipsec_opts, 'ipsec')
@ -169,7 +169,7 @@ class BaseSwanProcess(object):
self.config_dir = os.path.join(
self.conf.ipsec.config_base_dir, self.id)
self.etc_dir = os.path.join(self.config_dir, 'etc')
self.log_dir = os.path.join(self.config_dir, 'logs')
self.log_dir = os.path.join(self.config_dir, 'log')
self.update_vpnservice(vpnservice)
self.STATUS_PATTERN = re.compile(self.STATUS_RE)
self.STATUS_NOT_RUNNING_PATTERN = re.compile(
@ -565,7 +565,7 @@ class OpenSwanProcess(BaseSwanProcess):
'--virtual_private', virtual_private]
if self.conf.ipsec.enable_detailed_logging:
cmd += ['--perpeerlogbase', self.log_dir]
cmd += ['--perpeerlog', '--perpeerlogbase', self.log_dir]
self._execute(cmd)
#add connections
for ipsec_site_conn in self.vpnservice['ipsec_site_connections']: