Merge lp://staging/~doanac/utah/mir-bug into lp://staging/utah

Proposed by Andy Doan
Status: Merged
Merged at revision: 974
Proposed branch: lp://staging/~doanac/utah/mir-bug
Merge into: lp://staging/utah
Diff against target: 65 lines (+42/-0)
2 files modified
tests/test_rsyslog.py (+38/-0)
utah/provisioning/rsyslog.py (+4/-0)
To merge this branch: bzr merge lp://staging/~doanac/utah/mir-bug
Reviewer Review Type Date Requested Status
UTAH Dev Pending
Review via email: mp+176545@code.staging.launchpad.net

Description of the change

This fixes a subtle problem with our fast-forward logic in the rsyslog module

To post a comment you must log in.
Revision history for this message
Javier Collado (javier.collado) wrote :

The changes look good and the test cases work.

Just for my own curiosity, I tried to check that the changes were not needed if the pattern are just strings (which are converted to arrays internally), but that didn't work. Shouldn't that have worked?

=== modified file 'tests/test_rsyslog.py'
--- tests/test_rsyslog.py 2013-07-23 22:21:19 +0000
+++ tests/test_rsyslog.py 2013-07-24 16:55:22 +0000
@@ -162,16 +162,16 @@
         steps = [
             {
                 "message": "test_future",
- "pattern": [".*"],
+ "pattern": ".*",
                 "booted": True,
             },
             {
                 "message": "hit skipped",
- "pattern": ["hit skipped"],
+ "pattern": "hit skipped",
             },
             {
                 "message": "this will hit step three",
- "pattern": [".*this will hit step three"],
+ "pattern": ".*this will hit step three",
             },
         ]

=== modified file 'utah/provisioning/rsyslog.py'
--- utah/provisioning/rsyslog.py 2013-07-23 22:21:19 +0000
+++ utah/provisioning/rsyslog.py 2013-07-24 16:53:14 +0000
@@ -216,12 +216,8 @@

                 if not isinstance(pattern, list):
                     pattern = [pattern]
- else:
- pattern = pattern[:] # create a copy so we don't alter
                 if not isinstance(fail_pattern, list):
                     fail_pattern = [fail_pattern]
- else:
- fail_pattern = fail_pattern[:]
                 pattern.extend(fail_pattern)
                 future_pats = self._future_patterns(steps, x)
                 pattern.extend(future_pats)

Revision history for this message
Andy Doan (doanac) wrote :

On 07/24/2013 11:59 AM, Javier Collado wrote:
> Just for my own curiosity, I tried to check that the changes were not needed if the pattern are just strings (which are converted to arrays internally), but that didn't work. Shouldn't that have worked?

hmm- that type test fails when I run it at home?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: