diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2014-07-15 12:23:49 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2014-07-15 12:23:49 +0000 |
commit | e8adedb8f3f27d9212caf277b8e8f7c6792a20c2 (patch) | |
tree | f8460c9ff73cea780d944f18d1bab49f2653b1cf /morphlib/plugins | |
parent | 3f686a074fdb66e75e67e276d21bdc604b34920c (diff) | |
parent | 40a5c752de62dd1b3ef3ec0850f1f24e7af67052 (diff) | |
download | morph-e8adedb8f3f27d9212caf277b8e8f7c6792a20c2.tar.gz |
Fix JSON file handling to be binary filename safe
Reviewed-by: Lars Wirzenius
Reviewed-by: Pedro Alvarez
Diffstat (limited to 'morphlib/plugins')
-rw-r--r-- | morphlib/plugins/deploy_plugin.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/morphlib/plugins/deploy_plugin.py b/morphlib/plugins/deploy_plugin.py index 9384c422..30e356e8 100644 --- a/morphlib/plugins/deploy_plugin.py +++ b/morphlib/plugins/deploy_plugin.py @@ -497,7 +497,8 @@ class DeployPlugin(cliapp.Plugin): metadata_path = os.path.join( system_tree, 'baserock', 'deployment.meta') with morphlib.savefile.SaveFile(metadata_path, 'w') as f: - f.write(json.dumps(metadata, indent=4, sort_keys=True)) + json.dump(metadata, f, indent=4, + sort_keys=True, encoding='unicode-escape') return system_tree except Exception: shutil.rmtree(system_tree) |