From 2849c0decd2ce4f5f6a465df7edc5808e9bbc2f8 Mon Sep 17 00:00:00 2001 From: Mark Tickner Date: Fri, 21 Jul 2017 15:16:09 +0100 Subject: Remove added '_ansible_' JSON fields --- ghetto_json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ghetto_json b/ghetto_json index 60d8542..8341c4e 100755 --- a/ghetto_json +++ b/ghetto_json @@ -15,6 +15,10 @@ def main(params_list): path = params.pop('path') changed = False + for key in params.keys(): + if key.startswith('_ansible_'): + params.pop(key) + with open(path) as f: obj = json_load(f) for (key, target) in params.items(): @@ -55,4 +59,3 @@ if __name__ == '__main__': main(shlex.split(open(sys.argv[1]).read())) else: main(sys.argv[1:]) - -- cgit v1.2.3 From 718509eee06ecffb5580f45ff166c3fb4565f42f Mon Sep 17 00:00:00 2001 From: Mark Tickner Date: Tue, 25 Jul 2017 09:12:19 +0100 Subject: Add back empty last line --- ghetto_json | 1 + 1 file changed, 1 insertion(+) diff --git a/ghetto_json b/ghetto_json index 8341c4e..8d9e5bd 100755 --- a/ghetto_json +++ b/ghetto_json @@ -59,3 +59,4 @@ if __name__ == '__main__': main(shlex.split(open(sys.argv[1]).read())) else: main(sys.argv[1:]) + -- cgit v1.2.3