mirror of https://github.com/MISP/misp-galaxy
modify argument in add_missing_uuid script
parent
b3574f880a
commit
c5ed4cb457
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue