diff options
author | Zhongyue Luo <zhongyue.nah@intel.com> | 2013-04-09 13:40:26 +0800 |
---|---|---|
committer | Zhongyue Luo <zhongyue.nah@intel.com> | 2013-04-09 19:03:48 +0800 |
commit | e700d926f7d8fe2f57e53b93361aaf281bebc8ed (patch) | |
tree | e56e4ff20ca34ec4792e639b9cc1e8d2da06aef1 /openstack/common/rootwrap | |
parent | f9207b31f9599d9c8970ad3a3ae5f1e3720526fe (diff) | |
download | oslo-e700d926f7d8fe2f57e53b93361aaf281bebc8ed.tar.gz oslo-e700d926f7d8fe2f57e53b93361aaf281bebc8ed.tar.xz oslo-e700d926f7d8fe2f57e53b93361aaf281bebc8ed.zip |
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
Diffstat (limited to 'openstack/common/rootwrap')
-rwxr-xr-x | openstack/common/rootwrap/cmd.py | 9 |
1 files changed, 6 insertions, 3 deletions
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)) |