mirror of
https://github.com/MISP/misp-galaxy.git
synced 2024-11-29 18:27:19 +00:00
modify argument in add_missing_uuid script
This commit is contained in:
parent
b3574f880a
commit
c5ed4cb457
1 changed files with 3 additions and 3 deletions
|
@ -6,10 +6,10 @@ import argparse
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Add missing uuids in clusters')
|
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()
|
args = parser.parse_args()
|
||||||
|
|
||||||
with open(args.filename+'.json') as json_file:
|
with open(args.filename) as json_file:
|
||||||
data = json.load(json_file)
|
data = json.load(json_file)
|
||||||
json_file.close()
|
json_file.close()
|
||||||
|
|
||||||
|
@ -17,5 +17,5 @@ with open(args.filename+'.json') as json_file:
|
||||||
if 'uuid' not in value:
|
if 'uuid' not in value:
|
||||||
value['uuid'] = str(uuid.uuid4())
|
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)
|
json.dump(data, json_file, indent=4)
|
||||||
|
|
Loading…
Reference in a new issue