diff options
author | Matt Hart <matthew.hart@linaro.org> | 2015-09-07 12:37:59 +0100 |
---|---|---|
committer | Matt Hart <matthew.hart@linaro.org> | 2015-09-07 12:37:59 +0100 |
commit | 1e0ef88d570390296f69c78635643b342ccc5624 (patch) | |
tree | cf0870e6d1bff7ffb2b075101f3e2a7757cf8071 | |
parent | 914d18b875e7ebcf82264bcaa3030c1daadc5021 (diff) |
-rw-r--r-- | README | 9 | ||||
-rwxr-xr-x | bugzilla-params.py | 24 |
2 files changed, 33 insertions, 0 deletions
@@ -1,6 +1,15 @@ Linaro Bugzilla Tools ===================== +bugzilla-params.py: Takes as bugzilla 4.4 perl has params file and +converts it into a bugzilla 5.0 json params file. This is really only +useful when upgrading between these versions. + + +#### Below is obsolete as we deploy bugzilla from ansible-playbooks repo +#### it is left here for reference + + Thie repository contains tools necessary to deploy and configure Linaro bugzilla instance. diff --git a/bugzilla-params.py b/bugzilla-params.py new file mode 100755 index 0000000..ff08d84 --- /dev/null +++ b/bugzilla-params.py @@ -0,0 +1,24 @@ +#!/usr/bin/python + +import sys +import json +import subprocess + +new_file = open(sys.argv[2]).read() + +new_data = json.loads(new_file) + +perl_json = subprocess.Popen('perl -MJSON -le "do shift; print to_json(' + '\%param)" ' + sys.argv[1], shell=True, + stdout=subprocess.PIPE).stdout.read() +old_data = json.loads(perl_json) + +merged_data = {} + +for key, value in new_data.iteritems(): + if key in old_data: + merged_data[key] = old_data[key] + else: + merged_data[key] = new_data[key] + +print json.dumps(merged_data, indent=4, sort_keys=True) |