slightly more consistant stats process log names
Also a quick fix to the auditor tests xattr mock
This commit is contained in:
@@ -23,4 +23,4 @@ if __name__ == '__main__':
|
|||||||
# currently AccountStat only supports run_once
|
# currently AccountStat only supports run_once
|
||||||
options['once'] = True
|
options['once'] = True
|
||||||
run_daemon(AccountStat, conf_file, section_name='log-processor-stats',
|
run_daemon(AccountStat, conf_file, section_name='log-processor-stats',
|
||||||
**options)
|
log_name="account-stats", **options)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ if __name__ == '__main__':
|
|||||||
uploader_conf.update(plugin_conf)
|
uploader_conf.update(plugin_conf)
|
||||||
|
|
||||||
# pre-configure logger
|
# pre-configure logger
|
||||||
logger = utils.get_logger(uploader_conf, plugin, log_route='log-uploader',
|
logger = utils.get_logger(uploader_conf, log_route='log-uploader',
|
||||||
log_to_console=options.get('verbose', False))
|
log_to_console=options.get('verbose', False))
|
||||||
# currently LogUploader only supports run_once
|
# currently LogUploader only supports run_once
|
||||||
options['once'] = True
|
options['once'] = True
|
||||||
|
|||||||
@@ -26,10 +26,6 @@ class CatchErrorMiddleware(object):
|
|||||||
|
|
||||||
def __init__(self, app, conf):
|
def __init__(self, app, conf):
|
||||||
self.app = app
|
self.app = app
|
||||||
# if the application already has a logger we should use that one
|
|
||||||
self.logger = getattr(app, 'logger', None)
|
|
||||||
if not self.logger:
|
|
||||||
# and only call get_logger if we have to
|
|
||||||
self.logger = get_logger(conf, log_route='catch-errors')
|
self.logger = get_logger(conf, log_route='catch-errors')
|
||||||
|
|
||||||
def __call__(self, env, start_response):
|
def __call__(self, env, start_response):
|
||||||
|
|||||||
@@ -64,9 +64,9 @@ class LogUploader(Daemon):
|
|||||||
self.container_name = container_name
|
self.container_name = container_name
|
||||||
self.filename_format = source_filename_format
|
self.filename_format = source_filename_format
|
||||||
self.internal_proxy = InternalProxy(proxy_server_conf)
|
self.internal_proxy = InternalProxy(proxy_server_conf)
|
||||||
log_name = 'swift-log-uploader-%s' % plugin_name
|
log_name = '%s-log-uploader' % plugin_name
|
||||||
self.logger = \
|
self.logger = utils.get_logger(uploader_conf, log_name,
|
||||||
utils.get_logger(uploader_conf, plugin_name, log_route=plugin_name)
|
log_route=plugin_name)
|
||||||
|
|
||||||
def run_once(self):
|
def run_once(self):
|
||||||
self.logger.info(_("Uploading logs"))
|
self.logger.info(_("Uploading logs"))
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
# TODO: Tests
|
# TODO: Tests
|
||||||
from test import unit as _setup_mocks
|
from test import unit
|
||||||
import unittest
|
import unittest
|
||||||
import tempfile
|
import tempfile
|
||||||
import os
|
import os
|
||||||
@@ -57,6 +57,7 @@ class TestAuditor(unittest.TestCase):
|
|||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
rmtree(os.path.dirname(self.testdir), ignore_errors=1)
|
rmtree(os.path.dirname(self.testdir), ignore_errors=1)
|
||||||
|
unit.xattr_data = {}
|
||||||
|
|
||||||
def test_object_audit_extra_data(self):
|
def test_object_audit_extra_data(self):
|
||||||
self.auditor = auditor.ObjectAuditor(self.conf)
|
self.auditor = auditor.ObjectAuditor(self.conf)
|
||||||
|
|||||||
Reference in New Issue
Block a user