diff options
author | Mark Tickner <MarkTickner@users.noreply.github.com> | 2017-07-21 15:16:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-21 15:16:09 +0100 |
commit | 2849c0decd2ce4f5f6a465df7edc5808e9bbc2f8 (patch) | |
tree | a707781eb9325b2bebebc8fce25592be94e366f3 /ghetto_json | |
parent | 0f43790b23a94464765a81e72070304eeff7f387 (diff) | |
download | ghetto-json-2849c0decd2ce4f5f6a465df7edc5808e9bbc2f8.tar.gz ghetto-json-2849c0decd2ce4f5f6a465df7edc5808e9bbc2f8.tar.bz2 ghetto-json-2849c0decd2ce4f5f6a465df7edc5808e9bbc2f8.tar.xz ghetto-json-2849c0decd2ce4f5f6a465df7edc5808e9bbc2f8.zip |
Remove added '_ansible_' JSON fields
Diffstat (limited to 'ghetto_json')
-rwxr-xr-x | ghetto_json | 5 |
1 files changed, 4 insertions, 1 deletions
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:]) - |