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
=== modified file 'plainbox/plainbox/impl/session/manager.py'
--- plainbox/plainbox/impl/session/manager.py 2015-06-25 11:52:05 +0000
+++ plainbox/plainbox/impl/session/manager.py 2015-07-02 20:16:55 +0000
@@ -470,4 +470,16 @@
470 support = unit.support470 support = unit.support
471 if support:471 if support:
472 exporter_map[unit.id] = support472 exporter_map[unit.id] = support
473 # Patch exporter map to expose short names
474 legacy_mapping = {
475 '2013.com.canonical.plainbox::hexr': 'xml',
476 '2013.com.canonical.plainbox::html': 'html',
477 '2013.com.canonical.plainbox::json': 'json',
478 '2013.com.canonical.plainbox::rfc822': 'rfc822',
479 '2013.com.canonical.plainbox::text': 'text',
480 '2013.com.canonical.plainbox::xlsx': 'xlsx'
481 }
482 for new_id, legacy_id in legacy_mapping.items():
483 if new_id in exporter_map:
484 exporter_map[legacy_id] = exporter_map[new_id]
473 return exporter_map485 return exporter_map

Subscribers

People subscribed via source and target branches