Merge lp:~submarine/unity-scope-virtualbox/vboxmanage-parsing into lp:unity-scope-virtualbox

Proposed by David Callé on 2013-05-22
Status: Merged
Approved by: David Callé on 2013-05-22
Approved revision: 25
Merged at revision: 25
Proposed branch: lp:~submarine/unity-scope-virtualbox/vboxmanage-parsing
Merge into: lp:unity-scope-virtualbox
Diff against target: 25 lines (+3/-1)
2 files modified
src/unity_virtualbox_daemon.py (+2/-0)
tests/test_virtualbox.py (+1/-1)
To merge this branch: bzr merge lp:~submarine/unity-scope-virtualbox/vboxmanage-parsing
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve on 2013-05-22
Paweł Stołowski 2013-05-22 Approve on 2013-05-22
Review via email: mp+165037@code.launchpad.net

Commit message

Correctly parse vboxmanage output

Description of the change

This branch fixes vboxmanage output parsing, as the daemon interprets error messages as scope results.

To post a comment you must log in.
Paweł Stołowski (stolowski) wrote :

LGTM. +1

review: Approve
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/unity_virtualbox_daemon.py'
2--- src/unity_virtualbox_daemon.py 2013-04-09 10:34:13 +0000
3+++ src/unity_virtualbox_daemon.py 2013-05-22 09:09:25 +0000
4@@ -73,6 +73,8 @@
5 else:
6 vboxlist = EXTRA_DATA
7 for vbox in vboxlist.splitlines():
8+ if not re.match('\".*\"\s\{.*-.*\}', vbox.decode('utf-8')):
9+ continue
10 vbox_name = re.sub('\{.*\}', '', vbox.decode('utf-8'))
11 uuid = re.match(r'.*\{(.*)\}', vbox.decode('utf-8'))
12 if uuid:
13
14=== modified file 'tests/test_virtualbox.py'
15--- tests/test_virtualbox.py 2013-02-20 00:40:24 +0000
16+++ tests/test_virtualbox.py 2013-05-22 09:09:25 +0000
17@@ -39,7 +39,7 @@
18 self.scope_module = None
19
20 def test_valid_searches(self):
21- self.scope_module.EXTRA_DATA = '"Hardy Heron" {...}\n"Dapper Drake" {...}'.encode('utf-8')
22+ self.scope_module.EXTRA_DATA = '"Hardy Heron" {123-abc}\n"Dapper Drake" {abc-123}'.encode('utf-8')
23 expected_results = ['Hardy Heron']
24 results = []
25 for s in ['hardy']:

Subscribers

People subscribed via source and target branches

to all changes: