Commit 3b08bac0 authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Use deployit.logging to get logger name.

parent 3fe3b40b
......@@ -54,7 +54,7 @@ def setup_signal_handler():
signal.signal(signal.SIGINT, _signal_handler)
def setup_syslog_logging(logger_name):
syslog_logger = logging.getLogger(logger_name)
logger= logging.getLogger(logger_name)
syslog_handler = logging.handlers.SysLogHandler(address='/dev/log',
facility='daemon')
......@@ -62,7 +62,7 @@ def setup_syslog_logging(logger_name):
formatter = logging.Formatter('%(name)s: %(message)s')
syslog_handler.setFormatter(formatter)
syslog_logger .addHandler(syslog_handler)
logger.addHandler(syslog_handler)
def main():
global logger, children
......
......@@ -2,10 +2,11 @@
import os.path
import deployit.config
import deployit.logging
import ConfigParser
import logging
logger = logging.getLogger(__name__)
logger = logging.getLogger(deployit.logging.logger_name)
class ModuleConfig(object):
def __init__(self, modulename):
......
......@@ -2,6 +2,7 @@
import deployit.message
import deployit.modules
import deployit.rabbit
import deployit.logging
import json
import logging
import os
......@@ -9,7 +10,7 @@ import pika
import threading
import time
logger = logging.getLogger(__name__)
logger = logging.getLogger(deployit.logging.logger_name)
class RabbitModule(deployit.Module):
"""Base class for Management Agents
......
......@@ -2,8 +2,9 @@ import shutil
import datetime
import logging
import os
import deployit.logging
logger = logging.getLogger(__name__)
logger = logging.getLogger(deployit.logging.logger_name)
class BackupFile(object):
"""Create a backup files
......
......@@ -6,8 +6,9 @@ import logging
import re
import shutil
import subprocess
import deployit.logging
logger = logging.getLogger(__name__)
logger = logging.getLogger(deployit.logging.logger_name)
class DhcpSyntaxError(Exception):
def __init__(self):
......
......@@ -3,11 +3,12 @@ import subprocess
import managementagent.rabbitmodules
import managementagent.utils
import deployit.logging
__author__ = 'Rafael Ostertag <rafael.ostertag@math.uzh.ch>'
logger = logging.getLogger(__name__)
logger = logging.getLogger(deployit.logging.logger_name)
class EmailList(managementagent.RabbitModule):
......
......@@ -4,8 +4,9 @@ import os
import subprocess
import logging
import json
import deployit.logging
logger = logging.getLogger(__name__)
logger = logging.getLogger(deployit.logging.logger_name)
class GenericCommand(managementagent.RabbitModule):
"""Handling Generic Command Request"""
......@@ -16,10 +17,10 @@ class GenericCommand(managementagent.RabbitModule):
def process_message(self, message):
reply_to = message.header['uuid']
logger.debug('process message: %s', message)
logger.debug("obtaining module configuration for '%s'", self.name)
configuration = managementagent.ModuleConfig(self.name).get_config()
if configuration is None:
errmsg = "No configuration for '%s' found. Do nothing." % (self.name,)
logger.warning(errmsg)
......
import managementagent.rabbitmodules
import os
import logging
import deployit.logging
logger = logging.getLogger(__name__)
logger = logging.getLogger(deployit.logging.logger_name)
class Ping(managementagent.RabbitModule):
"""Handling a ping request"""
......
......@@ -8,10 +8,11 @@ import shutil
import subprocess
import pwd
import stat
import deployit.logging
__author__ = 'Rafael Ostertag <rafael.ostertag@math.uzh.ch>'
logger = logging.getLogger(__name__)
logger = logging.getLogger(deployit.logging.logger_name )
def find_process(username, command):
"""
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment