Merge lp://staging/~bjornt/landscape-client/process-state-key-error into lp://staging/~landscape/landscape-client/trunk

Proposed by Björn Tillenius
Status: Merged
Approved by: Jerry Seutter
Approved revision: 591
Merged at revision: 585
Proposed branch: lp://staging/~bjornt/landscape-client/process-state-key-error
Merge into: lp://staging/~landscape/landscape-client/trunk
Diff against target: 204 lines (+91/-26)
3 files modified
landscape/lib/process.py (+21/-23)
landscape/lib/tests/test_process.py (+67/-0)
landscape/monitor/tests/test_activeprocessinfo.py (+3/-3)
To merge this branch: bzr merge lp://staging/~bjornt/landscape-client/process-state-key-error
Reviewer Review Type Date Requested Status
Jerry Seutter (community) Approve
Alberto Donato Approve
Review via email: mp+128940@code.staging.launchpad.net

Description of the change

Handle new process states in when getting process information.

The bug report was about "t (tracing stop)", but a bunch of other states
can occur as well that we don't handle. I've change the code to use the
one-character representation of the process state that the kernel uses,
instead of using our own mapping. This ensure that future state
additions will be handled as well. As a result, we now represent the
"tracing stop" state as "t" instead of "I", but as far as I can see, the
only state we're explicitly checking for in our code is Z, so that
change shouldn't cause a problem.

I put in a special-case for "T (tracing stop)", since in Lucid you can
have both "T (stopped)" and "T (tracing stop)". I made it so that the
latter is represented by "t", since that's the way it is in releases
newer than Lucid.

To post a comment you must log in.
Revision history for this message
Alberto Donato (ack) wrote :

Nice fix, +1!

review: Approve
Revision history for this message
Alberto Donato (ack) wrote :

#1:
I have a test failure in landscape.monitor.tests.test_activeprocessinfo.ActiveProcessInfoTest.test_read_sample_data, related to the "I" to "t" change.

591. By Björn Tillenius

Fix test failures.

Revision history for this message
Björn Tillenius (bjornt) wrote :

On Wed, Oct 10, 2012 at 03:20:07PM -0000, Alberto Donato wrote:
> #1:
> I have a test failure in
> landscape.monitor.tests.test_activeprocessinfo.ActiveProcessInfoTest.test_read_sample_data,
> related to the "I" to "t" change.

Indeed. There were two other similar test failures as well. I've fixed
the tests to expect "t" now.

--
Björn Tillenius | https://launchpad.net/~bjornt

Revision history for this message
Jerry Seutter (jseutter) wrote :

+1, looks good!

review: Approve

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: