Merge ~jocave/checkbox-ng:indent-manifest-json into checkbox-ng:master

Proposed by Jonathan Cave
Status: Merged
Approved by: Jonathan Cave
Approved revision: 92f0dff205c4feb627b17356084ea00e738d3a6b
Merged at revision: 0670c6ea484d96f22284953e2bba1258a2139c40
Proposed branch: ~jocave/checkbox-ng:indent-manifest-json
Merge into: checkbox-ng:master
Diff against target: 21 lines (+2/-2)
1 file modified
plainbox/impl/providers/manifest/bin/plainbox-manifest-collect (+2/-2)
Reviewer Review Type Date Requested Status
Maciej Kisielewski Approve
Review via email: mp+352826@code.launchpad.net

Description of the change

When dumping the machine-manifest.json file (e.g. after the collect-manifest job ran) request to indent the file rather using the most compact output.

This means if for some reason you want to edit the inspect the file or edit it by hand you can more easily find the entry you want.

Tested by building a snap and re-running collect-manifest job.

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

LGTM, +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/plainbox/impl/providers/manifest/bin/plainbox-manifest-collect b/plainbox/impl/providers/manifest/bin/plainbox-manifest-collect
index 0dfb02a..dbffaee 100755
--- a/plainbox/impl/providers/manifest/bin/plainbox-manifest-collect
+++ b/plainbox/impl/providers/manifest/bin/plainbox-manifest-collect
@@ -1,7 +1,7 @@
1#!/usr/bin/env python31#!/usr/bin/env python3
2# This file is part of Checkbox.2# This file is part of Checkbox.
3#3#
4# Copyright 2015 Canonical Ltd.4# Copyright 2015-2018 Canonical Ltd.
5# Written by:5# Written by:
6# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>6# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
7#7#
@@ -151,7 +151,7 @@ def main():
151 print(_("Saving manifest to {}").format(args.manifest))151 print(_("Saving manifest to {}").format(args.manifest))
152 os.makedirs(os.path.dirname(args.manifest), exist_ok=True)152 os.makedirs(os.path.dirname(args.manifest), exist_ok=True)
153 with open(args.manifest, 'wt', encoding='UTF-8') as stream:153 with open(args.manifest, 'wt', encoding='UTF-8') as stream:
154 json.dump(manifest, stream, sort_keys=True)154 json.dump(manifest, stream, sort_keys=True, indent=2)
155 else:155 else:
156 print(_("No changes to the manifest are required"))156 print(_("No changes to the manifest are required"))
157157

Subscribers

People subscribed via source and target branches