Merge lp:~nuclearbob/utah/psutil-2 into lp:utah

Proposed by Max Brustkern
Status: Merged
Approved by: Francis Ginther
Approved revision: 1050
Merged at revision: 1064
Proposed branch: lp:~nuclearbob/utah/psutil-2
Merge into: lp:utah
Diff against target: 15 lines (+4/-1)
1 file modified
utah/process.py (+4/-1)
To merge this branch: bzr merge lp:~nuclearbob/utah/psutil-2
Reviewer Review Type Date Requested Status
Para Siva (community) Approve
Review via email: mp+226313@code.launchpad.net

Description of the change

This branch checks for psutil > 2 and uses cmdline() instead of cmdline if that is installed. I've only been able to test it on utopic so far, so maybe someone can help me test it on older versions.

To post a comment you must log in.
Revision history for this message
Para Siva (psivaa) wrote :

+1. Worked on a trusty with (1,2,1) psutil

review: Approve
Revision history for this message
Max Brustkern (nuclearbob) wrote :

Should I go ahead and merge this, or should somebody from CI do it?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'utah/process.py'
2--- utah/process.py 2014-06-01 22:01:15 +0000
3+++ utah/process.py 2014-07-10 15:00:32 +0000
4@@ -84,7 +84,10 @@
5 cmdlines = []
6 for pid in pids:
7 try:
8- cmdlines.append(' '.join(psutil.Process(pid).cmdline))
9+ if psutil.version_info > (2, 0, 0):
10+ cmdlines.append(' '.join(psutil.Process(pid).cmdline()))
11+ else:
12+ cmdlines.append(' '.join(psutil.Process(pid).cmdline))
13 except psutil.NoSuchProcess:
14 pass
15 return any(pattern in cmdline for cmdline in cmdlines)

Subscribers

People subscribed via source and target branches