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(-) (limited to 'ghetto_json') 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