Use property class name in object ID

pull/412/head
Richard van den Berg 2015-02-25 09:50:00 +01:00
parent 8b89caf5b9
commit a4fd3b957a
1 changed files with 3 additions and 2 deletions

View File

@ -40,8 +40,9 @@ def generateObservable(indicator, attribute):
if (attribute["type"] in simple_type_to_method.keys()):
action = getattr(this_module, simple_type_to_method[attribute["type"]], None)
if (action != None):
object = Object(action(attribute))
object.id_ = cybox.utils.idgen.__generator.namespace.prefix + ":" + attribute["type"] + "-" + attribute["uuid"]
property = action(attribute)
object = Object(property)
object.id_ = cybox.utils.idgen.__generator.namespace.prefix + ":" + property.__class__.__name__ + "-" + attribute["uuid"]
observable = Observable(object)
observable.id_ = cybox.utils.idgen.__generator.namespace.prefix + ":observable-" + attribute["uuid"]
indicator.add_observable(observable)