10 Commits

Author SHA1 Message Date
Jenkins
4e7a576227 Merge "Log stdout, stderr and command on execute() error" 2014-09-08 11:01:04 +00:00
Amrith Kumar
0923ea1c23 Log stdout, stderr and command on execute() error
It would help debugging considerably if a failure in execute()
generated a message (at a client specified logging level). Such a
message, generated by execute() would only occur if the user requested
it by specifying a parameter (log_errors), and execute() were to throw
an exception. As an example, this change would address the issue being
addressed in bug 1340124 for the Trove project only.

DocImpact: New parameter added to processutils.execute().  The
possible values of the log_errors parameter are 'all' or 'final'. The
default value of None implies no logging. If it is set to 'final',
stdout and stderr are logged on the final failure. If it is set to
'all', stdout and stderr are logged on every failure.

Originally-submitted-in: If8180e042e1a05374ef705f5873cc0981243619f

Change-Id: Id9e94bd8d009b8f134f0b681da5dec5717d662ff
DocImpact:
Closes-Bug: #1342857
Suggested-By: Peter Stachowski <peter@tesora.com>
Reported-By: Ionuț Arțăriși <iartarisi@suse.cz>
2014-09-02 22:23:41 -04:00
Amrith Kumar
ae9e05bfc3 Mask passwords in exceptions and error messages
When a ProcessExecutionError is thrown by processutils.ssh_execute(),
the exception may contain information such as password. Upstream
applications that just log the message (as several appear to do) could
inadvertently expose these passwords to a user with read access to the
log files. It is therefore considered prudent to invoke
strutils.mask_password() on the command, stdout and stderr in the
exception. A test case has been added to ensure that all three are
properly masked.

An earlier commit (e8199714) failed to address ssh_execute(). This
change set addresses ssh_execute.

OSSA is aware of this change request.

Change-Id: I0db9e98cbeb2a5e6f9ae0074f24717aa91cfc238
Closes-Bug: #1343604
2014-08-29 06:31:24 -04:00
Jenkins
ddbce65897 Merge "Switch to oslo.i18n in our code" 2014-08-24 16:37:16 +00:00
Jenkins
36f6d8f070 Merge "Switch to oslo.utils in our code" 2014-08-22 15:11:46 +00:00
Yuriy Taraday
8a2ba06743 Switch to oslo.i18n in our code
Note that gettextutils are still indirectly used by fileutils (through log).

Change-Id: I4ea4830ed149aff87146a4b7392d7e48c6a7c793
2014-08-21 21:10:18 +04:00
Yuriy Taraday
9159a168fb Switch to oslo.utils in our code
Note that strutils is still used by jsonutils and log (used by
fileutils), so it isn't removed from openstack/common/.

Change-Id: I3a1e526c4310869747a4999e52a527604703e979
2014-08-21 09:17:51 +04:00
Amrith Kumar
c906dccefc Mask passwords in exceptions and error messages
When a ProcessExecutionError is thrown by processutils.execute(), the
exception may contain information such as password. Upstream
applications that just log the message (as several appear to do) could
inadvertently expose these passwords to a user with read access to the
log files. It is therefore considered prudent to invoke
strutils.mask_password() on the command, stdout and stderr in the
exception. A test case has been added to ensure that all three are
properly masked.

OSSA is aware of this change request.

Originally-Submitted-In: I173dfb865e84eb7dee54a22c76db1e4f125a0a8a

Change-Id: Ie122db5f19802f519b96ed024ab3f2b5eede3eee
Closes-Bug: #1343604
2014-08-20 17:47:02 -04:00
Yuriy Taraday
1761de8f02 Make all tests pass 2014-08-07 22:27:31 +04:00
Yuriy Taraday
6fc3e6808b exported from oslo-incubator by graduate.sh 2014-08-07 22:26:50 +04:00