Merge lp:~elopio/autopilot/fix1248751-two_dots into lp:autopilot

Proposed by Leo Arias
Status: Merged
Approved by: Thomi Richards
Approved revision: 359
Merged at revision: 359
Proposed branch: lp:~elopio/autopilot/fix1248751-two_dots
Merge into: lp:autopilot
Diff against target: 34 lines (+5/-2)
2 files modified
autopilot/logging.py (+3/-0)
autopilot/tests/unit/test_logging.py (+2/-2)
To merge this branch: bzr merge lp:~elopio/autopilot/fix1248751-two_dots
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Thomi Richards (community) Approve
Review via email: mp+194254@code.launchpad.net

Commit message

On the log_action decorator, do not duplicate the ending period.

To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'autopilot/logging.py'
2--- autopilot/logging.py 2013-09-17 14:04:05 +0000
3+++ autopilot/logging.py 2013-11-06 22:56:57 +0000
4@@ -36,6 +36,9 @@
5 docstring = docstring.split('\n')[0].strip()
6 else:
7 docstring = f.__name__
8+ # Strip the ending periods of the docstring, if present, so only
9+ # one will remain after using the log line format.
10+ docstring = docstring.rstrip('.')
11 log_line = '%s: %s. Arguments %s. Keyword arguments: %s.'
12 log_func(
13 log_line, class_name, docstring, pprint.pformat(args),
14
15=== modified file 'autopilot/tests/unit/test_logging.py'
16--- autopilot/tests/unit/test_logging.py 2013-09-16 17:44:20 +0000
17+++ autopilot/tests/unit/test_logging.py 2013-11-06 22:56:57 +0000
18@@ -125,7 +125,7 @@
19 'arg1', 'arg2', arg3='arg3', arg4='arg4')
20 self.assertLogLevelContains(
21 'INFO',
22- "ObjectWithLogDecorator: Do something with docstring.. "
23+ "ObjectWithLogDecorator: Do something with docstring. "
24 "Arguments ('arg1', 'arg2'). "
25 "Keyword arguments: {'arg3': 'arg3', 'arg4': 'arg4'}.")
26
27@@ -135,6 +135,6 @@
28 self.assertLogLevelContains(
29 'INFO',
30 "ObjectWithLogDecorator: "
31- "Do something with a multiline docstring.. "
32+ "Do something with a multiline docstring. "
33 "Arguments ('arg1', 'arg2'). "
34 "Keyword arguments: {'arg3': 'arg3', 'arg4': 'arg4'}.")

Subscribers

People subscribed via source and target branches