Do not modify rsyslog files if rsyslog is not used.
Swift was missing an 'if [[ $SYSLOG != "False" ]]' statement which is used
by other services, and therefor failed with a 'No such file or directory'
error when 'SYSLOG=False' was set in localrc.
Closes-Bug: 1308461
Change-Id: I8655a955ebb322516d92bee418b93d4cc23bdc5c
diff --git a/lib/swift b/lib/swift
index 3e183ff..6db779a 100644
--- a/lib/swift
+++ b/lib/swift
@@ -453,10 +453,13 @@
rm -rf ${swift_log_dir}
mkdir -p ${swift_log_dir}/hourly
sudo chown -R ${STACK_USER}:adm ${swift_log_dir}
- sed "s,%SWIFT_LOGDIR%,${swift_log_dir}," $FILES/swift/rsyslog.conf | sudo \
- tee /etc/rsyslog.d/10-swift.conf
- # restart syslog to take the changes
- sudo killall -HUP rsyslogd
+
+ if [[ $SYSLOG != "False" ]]; then
+ sed "s,%SWIFT_LOGDIR%,${swift_log_dir}," $FILES/swift/rsyslog.conf | sudo \
+ tee /etc/rsyslog.d/10-swift.conf
+ # restart syslog to take the changes
+ sudo killall -HUP rsyslogd
+ fi
if is_apache_enabled_service swift; then
_config_swift_apache_wsgi