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
1diff --git a/plainbox/impl/providers/manifest/bin/plainbox-manifest-collect b/plainbox/impl/providers/manifest/bin/plainbox-manifest-collect
2index 0dfb02a..dbffaee 100755
3--- a/plainbox/impl/providers/manifest/bin/plainbox-manifest-collect
4+++ b/plainbox/impl/providers/manifest/bin/plainbox-manifest-collect
5@@ -1,7 +1,7 @@
6 #!/usr/bin/env python3
7 # This file is part of Checkbox.
8 #
9-# Copyright 2015 Canonical Ltd.
10+# Copyright 2015-2018 Canonical Ltd.
11 # Written by:
12 # Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
13 #
14@@ -151,7 +151,7 @@ def main():
15 print(_("Saving manifest to {}").format(args.manifest))
16 os.makedirs(os.path.dirname(args.manifest), exist_ok=True)
17 with open(args.manifest, 'wt', encoding='UTF-8') as stream:
18- json.dump(manifest, stream, sort_keys=True)
19+ json.dump(manifest, stream, sort_keys=True, indent=2)
20 else:
21 print(_("No changes to the manifest are required"))
22

Subscribers

People subscribed via source and target branches