Skip non-existing expanded value

pull/24/head
Alexandre Dulaunoy 2016-06-21 07:53:31 +02:00
parent 3758179c9a
commit 40f8555f72
1 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@
# Python script parsing the MISP taxonomies expressed in Machine Tags (Triple # Python script parsing the MISP taxonomies expressed in Machine Tags (Triple
# Tags) to list all valid tags from a specific taxonomy. # Tags) to list all valid tags from a specific taxonomy.
# #
# Copyright (c) 2015 Alexandre Dulaunoy - a@foo.be # Copyright (c) 2015-2016 Alexandre Dulaunoy - a@foo.be
# #
# Redistribution and use in source and binary forms, with or without modification, # Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met: # are permitted provided that the following conditions are met:
@ -113,7 +113,7 @@ for taxonomy in taxonomies:
if 'expanded' in predicate: if 'expanded' in predicate:
expanded = predicate['expanded'] expanded = predicate['expanded']
for v in e['entry']: for v in e['entry']:
if args.a: if args.a and 'expanded' in v:
doc = asciidoc(content=machineTag(namespace=namespace, predicate=e['predicate'], value=v['value']), adoc=doc) doc = asciidoc(content=machineTag(namespace=namespace, predicate=e['predicate'], value=v['value']), adoc=doc)
doc = asciidoc(content=machineTag(namespace=namespace, predicate=v['expanded']), adoc=doc, t='description') doc = asciidoc(content=machineTag(namespace=namespace, predicate=v['expanded']), adoc=doc, t='description')
else: else: