-
Notifications
You must be signed in to change notification settings - Fork 26
Description
A TypeError is raised when listing the content of a volume instance of a PreStdLogicalImageContainer. (For instance, calling the printLogicalImageInfo() function in aff4.py. The error I got:
TypeError: __init__() missing 1 required positional argument: 'pathName'
I found the issue is in container.LogicalImageContainer and container.PreStdLogicalImageContainer classes. While the method images() of the first class initialize correctly the LogicalImage instance to be yield:
yield aff4.LogicalImage(self, self.resolver, self.urn, image, pathName)
the method images() of PreStdLogicalImageContainer class and method open() of both classes missed to pass the container (self) as first parameter:
yield aff4.LogicalImage(self.resolver, self.urn, image, pathName)
...
return aff4.LogicalImage(self.resolver, self.urn, urn, pathName)Initializer of aff4.LogicalImage expects the container as first parameter:
class LogicalImage(AFF4Object):
def __init__(self, container, resolver, volume, urn, pathName):
super(LogicalImage, self).__init__(resolver, urn)
self.volume = volume
self.pathName = pathName
self.container = containerJust passing self as first parameter should solve the issue.
(I could prepare a pull request if needed, but I would like to have some guide about branch naming, etc.)