Merge ~sylvain-pineau/plainbox:json_exporter_update into plainbox:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 7bd552e137fdbf15ff3458f15ede0b28856cb6e0
Merged at revision: 54cb6233a1684bf3c1291f8311a23e1c60772973
Proposed branch: ~sylvain-pineau/plainbox:json_exporter_update
Merge into: plainbox:master
Diff against target: 29 lines (+20/-0)
1 file modified
plainbox/impl/providers/exporters/data/checkbox.json (+20/-0)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+309662@code.launchpad.net

Description of the change

An update of the new json exporter template to add recovery/bto/buildstamp info, which brings feature parity with the xml submission parser.

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

self-approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/plainbox/impl/providers/exporters/data/checkbox.json b/plainbox/impl/providers/exporters/data/checkbox.json
2index d0f8d96..def6562 100644
3--- a/plainbox/impl/providers/exporters/data/checkbox.json
4+++ b/plainbox/impl/providers/exporters/data/checkbox.json
5@@ -114,4 +114,24 @@
6 "kernel-cmdline": {{ kernel_cmdline.strip() | jsonify | safe }}
7 }
8 {%- endif %}
9+ {%- if ns ~ 'dell_bto_xml_attachment_json' in state.job_state_map and state.job_state_map[ns ~ 'dell_bto_xml_attachment_json'].result.outcome == 'pass' %},
10+ {
11+ {%- set bto = state.job_state_map[ns ~ 'dell_bto_xml_attachment_json'].result.io_log_as_text_attachment %}
12+ "bto-info": {{ bto | indent(8, false) | safe }}
13+ }
14+ {%- endif %}
15+ {%- if ns ~ 'recovery_info_attachment_json' in state.job_state_map and state.job_state_map[ns ~ 'recovery_info_attachment_json'].result.outcome == 'pass' %},
16+ {
17+ {%- set recovery = state.job_state_map[ns ~ 'recovery_info_attachment_json'].result.io_log_as_text_attachment %}
18+ "image-version": {{ recovery | indent(8, false) | safe }}
19+ }
20+ {%- endif %}
21+ {%- if ns ~ 'info/buildstamp' in state.job_state_map and state.job_state_map[ns ~ 'info/buildstamp'].result.outcome %}
22+ {%- set buildstamp = state.job_state_map[ns ~ 'info/buildstamp'].result.io_log_as_text_attachment.rstrip().splitlines() %}
23+ {%- if buildstamp|length == 2 %},
24+ {
25+ "buildstamp": {{ buildstamp[1] | jsonify | safe }}
26+ }
27+ {%- endif %}
28+ {%- endif %}
29 ]

Subscribers

People subscribed via source and target branches