modify argument in add_missing_uuid script

This commit is contained in:
Deborah Servili 2018-02-28 16:19:16 +01:00
parent b3574f880a
commit c5ed4cb457

View file

@ -6,10 +6,10 @@ import argparse
import uuid
parser = argparse.ArgumentParser(description='Add missing uuids in clusters')
parser.add_argument("-f", "--filename", required=True, help="nameof the cluster (without .json)")
parser.add_argument("-f", "--filename", required=True, help="name of the cluster")
args = parser.parse_args()
with open(args.filename+'.json') as json_file:
with open(args.filename) as json_file:
data = json.load(json_file)
json_file.close()
@ -17,5 +17,5 @@ with open(args.filename+'.json') as json_file:
if 'uuid' not in value:
value['uuid'] = str(uuid.uuid4())
with open(args.filename+'.json', 'w') as json_file:
with open(args.filename, 'w') as json_file:
json.dump(data, json_file, indent=4)