Merge lp:~zyga/checkbox/fix-exporter-regression into lp:checkbox

Proposed by Zygmunt Krynicki
Status: Merged
Approved by: Maciej Kisielewski
Approved revision: 3872
Merged at revision: 3873
Proposed branch: lp:~zyga/checkbox/fix-exporter-regression
Merge into: lp:checkbox
Diff against target: 20 lines (+12/-0)
1 file modified
plainbox/plainbox/impl/session/manager.py (+12/-0)
To merge this branch: bzr merge lp:~zyga/checkbox/fix-exporter-regression
Reviewer Review Type Date Requested Status
Maciej Kisielewski Approve
Review via email: mp+263718@code.launchpad.net

Description of the change

This fixes a regression introduced with exporter units. Any script that today uses -f json (etc) should work forever. We keep our public APIs small (cli tools and file formats) but precious.

To post a comment you must log in.
Revision history for this message
Maciej Kisielewski (kissiel) wrote :

Tested, looks good.
overall +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plainbox/plainbox/impl/session/manager.py'
2--- plainbox/plainbox/impl/session/manager.py 2015-06-25 11:52:05 +0000
3+++ plainbox/plainbox/impl/session/manager.py 2015-07-02 20:16:55 +0000
4@@ -470,4 +470,16 @@
5 support = unit.support
6 if support:
7 exporter_map[unit.id] = support
8+ # Patch exporter map to expose short names
9+ legacy_mapping = {
10+ '2013.com.canonical.plainbox::hexr': 'xml',
11+ '2013.com.canonical.plainbox::html': 'html',
12+ '2013.com.canonical.plainbox::json': 'json',
13+ '2013.com.canonical.plainbox::rfc822': 'rfc822',
14+ '2013.com.canonical.plainbox::text': 'text',
15+ '2013.com.canonical.plainbox::xlsx': 'xlsx'
16+ }
17+ for new_id, legacy_id in legacy_mapping.items():
18+ if new_id in exporter_map:
19+ exporter_map[legacy_id] = exporter_map[new_id]
20 return exporter_map

Subscribers

People subscribed via source and target branches