If I build a WinEventLog object and set the type field on it, I get the following error during to_xml():
Python2.7.8 (default, Jul282014, 01:34:03)
[GCC4.8.3] oncygwinType"help", "copyright", "credits"or"license"formoreinformation.
>>>fromcybox.objects.win_event_log_objectimportWinEventLog>>>w=WinEventLog()
>>>w.type="foobar">>>printw.to_xml()
Traceback (mostrecentcalllast):
File"<stdin>", line1, in<module>File"/home/bworrell/.virtualenvs/openioc-to-stix/lib/python2.7/site-packages/cybox/__init__.py", line295, into_xmlself.to_obj().export(
File"/home/bworrell/.virtualenvs/openioc-to-stix/lib/python2.7/site-packages/cybox/common/object_properties.py", line105, into_objreturnsuper(ObjectProperties, self).to_obj(return_obj=return_obj, ns_info=ns_info)
File"/home/bworrell/.virtualenvs/openioc-to-stix/lib/python2.7/site-packages/cybox/__init__.py", line142, into_objval=getattr(self, field.attr_name)
AttributeError: 'WinEventLog'objecthasnoattribute'type_'
I believe this is due to the TypedField.attrname property, which converts the XML fieldname "Type" to "type" and then appends an underscore because it's a builtin function. We should probably convert those to type_ as we did in #213.
This probably causes issues with the WinNetworkShare object's type field as well.
Related to #188.
If I build a
WinEventLogobject and set thetypefield on it, I get the following error duringto_xml():I believe this is due to the
TypedField.attrnameproperty, which converts the XML fieldname"Type"to"type"and then appends an underscore because it's a builtin function. We should probably convert those totype_as we did in #213.This probably causes issues with the
WinNetworkShareobject'stypefield as well.Related to #188.