From 40f8555f724aabb57fad9c520a84474fb5d339e8 Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Tue, 21 Jun 2016 07:53:31 +0200 Subject: [PATCH] Skip non-existing expanded value --- tools/machinetag.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/machinetag.py b/tools/machinetag.py index c09b8bf..64a3f51 100755 --- a/tools/machinetag.py +++ b/tools/machinetag.py @@ -4,7 +4,7 @@ # Python script parsing the MISP taxonomies expressed in Machine Tags (Triple # 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, # are permitted provided that the following conditions are met: @@ -113,7 +113,7 @@ for taxonomy in taxonomies: if 'expanded' in predicate: expanded = predicate['expanded'] 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=v['expanded']), adoc=doc, t='description') else: