]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Sync processutils and log from oslo
authorTomoki Sekiyama <tomoki.sekiyama@hds.com>
Tue, 8 Jul 2014 21:17:51 +0000 (17:17 -0400)
committerTomoki Sekiyama <tomoki.sekiyama@hds.com>
Wed, 9 Jul 2014 14:29:47 +0000 (14:29 +0000)
This change syncs in:

33afb20 Fix broken formatting of processutils.execute log statement
5e3d3a5 Mask passwords included without quotes at the ends of commands
6751b30 Remove extra whitespace

The most important part is '33afb20' which was broken cinder debug logging
on running commands after last oslo sync.

Change-Id: I77e0f943d39bb34ff95bac1e9d63d7450f8c24bf

cinder/openstack/common/log.py
cinder/openstack/common/processutils.py
etc/cinder/cinder.conf.sample

index 3e1e968493a70075c531259832ef18ab1fe66f1b..5307e41db8810bf752ef467cfc5bfaa228d3a7a5 100644 (file)
@@ -62,7 +62,7 @@ _FORMAT_PATTERNS = [r'(%(key)s\s*[=]\s*[\"\']).*?([\"\'])',
                     r'([\'"].*?%(key)s[\'"]\s*:\s*u?[\'"]).*?([\'"])',
                     r'([\'"].*?%(key)s[\'"]\s*,\s*\'--?[A-z]+\'\s*,\s*u?[\'"])'
                     '.*?([\'"])',
-                    r'(%(key)s\s*--?[A-z]+\s*).*?([\s])']
+                    r'(%(key)s\s*--?[A-z]+\s*)\S+(\s*)']
 
 for key in _SANITIZE_KEYS:
     for pattern in _FORMAT_PATTERNS:
@@ -181,11 +181,11 @@ log_opts = [
     cfg.StrOpt('instance_format',
                default='[instance: %(uuid)s] ',
                help='The format for an instance that is passed with the log '
-                    'message. '),
+                    'message.'),
     cfg.StrOpt('instance_uuid_format',
                default='[instance: %(uuid)s] ',
                help='The format for an instance UUID that is passed with the '
-                    'log message. '),
+                    'log message.'),
 ]
 
 CONF = cfg.CONF
index 1743106aaa05fe05b8bd130e4bd7ab0c5e92fb98..ace43c88a8d1b6673f31376f17aed1731a60b6f7 100644 (file)
@@ -157,7 +157,7 @@ def execute(*cmd, **kwargs):
         attempts -= 1
         try:
             LOG.log(loglevel, 'Running cmd (subprocess): %s',
-                    ' '.join(logging.mask_password(cmd)))
+                    logging.mask_password(' '.join(cmd)))
             _PIPE = subprocess.PIPE  # pylint: disable=E1101
 
             if os.name == 'nt':
index 6eebf405cafd7347e907d024df4bc9b9897e8a65..60641aee6f0997f0c1c63499a928409feffa23ca 100644 (file)
 #fatal_deprecations=false
 
 # The format for an instance that is passed with the log
-# message.  (string value)
+# message. (string value)
 #instance_format="[instance: %(uuid)s] "
 
 # The format for an instance UUID that is passed with the log
-# message.  (string value)
+# message. (string value)
 #instance_uuid_format="[instance: %(uuid)s] "
 
 # The name of a logging configuration file. This file is