From e700d926f7d8fe2f57e53b93361aaf281bebc8ed Mon Sep 17 00:00:00 2001 From: Zhongyue Luo Date: Tue, 9 Apr 2013 13:40:26 +0800 Subject: Replaces standard logging with common logging Common modules can now safely import other common modules since update.py will automatically install dependencies. Change-Id: I0ad12d7e6e623657c40659aca4148439cd03d3fa --- openstack/common/rootwrap/cmd.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'openstack/common/rootwrap') diff --git a/openstack/common/rootwrap/cmd.py b/openstack/common/rootwrap/cmd.py index 92552f1..23986ac 100755 --- a/openstack/common/rootwrap/cmd.py +++ b/openstack/common/rootwrap/cmd.py @@ -34,13 +34,16 @@ """ import ConfigParser -import logging import os import pwd import signal import subprocess import sys +from openstack.common import log as logging + + +LOG = logging.getLogger(__name__) RC_UNAUTHORIZED = 99 RC_NOCOMMAND = 98 @@ -57,7 +60,7 @@ def _subprocess_setup(): def _exit_error(execname, message, errorcode, log=True): print "%s: %s" % (execname, message) if log: - logging.error(message) + LOG.error(message) sys.exit(errorcode) @@ -104,7 +107,7 @@ def main(): command = filtermatch.get_command(userargs, exec_dirs=config.exec_dirs) if config.use_syslog: - logging.info("(%s > %s) Executing %s (filter match = %s)" % ( + LOG.info("(%s > %s) Executing %s (filter match = %s)" % ( os.getlogin(), pwd.getpwuid(os.getuid())[0], command, filtermatch.name)) -- cgit