YongchaoWu | 4e489b0 | 2020-02-24 09:18:16 +0100 | [diff] [blame] | 1 | import json |
| 2 | import subprocess |
| 3 | import os |
| 4 | |
| 5 | print("Clean old ric configurations in Consul config file") |
| 6 | |
| 7 | p = os.path.abspath('..') |
| 8 | consul_config = p + '/consul_cbs' + '/config.json' |
| 9 | |
| 10 | |
| 11 | def write_json(data, filename=consul_config): |
| 12 | with open(filename, 'w') as f: |
| 13 | json.dump(data, f, indent=4) |
| 14 | |
| 15 | |
| 16 | with open(consul_config) as json_file: |
| 17 | clean = json.load(json_file) |
| 18 | clean['ric'] = [] |
| 19 | |
| 20 | |
| 21 | write_json(clean) |
| 22 | print("Clean old ric configurations from Consul config file, done") |
| 23 | |
| 24 | |