Expected Behavior
A navigation layer object should be created when passing a name and a domain to mitreattack.navlayers.layer
Actual Behavior
The program errors out since in the init method uses self.__data (double underscore), but the rest of the code uses self._data (single underscore)
Steps to Reproduce the Problem
Follow example 2 of https://github.com/mitre-attack/mitreattack-python/tree/master/mitreattack/navlayers/core#creating-layers-programmatically
- Init a navigation layer with a name and a domain
import mitreattack.navlayers as navlayers
layer_example = navlayers.Layer(name="example", domain="enterprise-attack")
Traceback (most recent call last):
File "/Users/me/test/test.py", line 3, in test
layer_example = navlayers.Layer(name="example", domain="enterprise-attack")
File "/Users/me/.local/share/virtualenvs/test-XrAZKEUD/lib/python3.8/site-packages/mitreattack/navlayers/core/layer.py", line 19, in __init__
self._build()
File "/Users/me/.local/share/virtualenvs/test-XrAZKEUD/lib/python3.8/site-packages/mitreattack/navlayers/core/layer.py", line 82, in _build
self.__layer = _LayerObj(self._data['name'], self._data['domain'])
AttributeError: 'Layer' object has no attribute '_data'
Possible Solution
Change self.__data (double underscore) to self._data (single underscore).
Expected Behavior
A navigation layer object should be created when passing a name and a domain to mitreattack.navlayers.layer
Actual Behavior
The program errors out since in the init method uses
self.__data(double underscore), but the rest of the code usesself._data(single underscore)Steps to Reproduce the Problem
Follow example 2 of https://github.com/mitre-attack/mitreattack-python/tree/master/mitreattack/navlayers/core#creating-layers-programmatically
Possible Solution
Change
self.__data(double underscore) toself._data(single underscore).