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 = container
Just 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.)
A TypeError is raised when listing the content of a volume instance of a
PreStdLogicalImageContainer. (For instance, calling theprintLogicalImageInfo()function in aff4.py. The error I got:I found the issue is in
container.LogicalImageContainerandcontainer.PreStdLogicalImageContainerclasses. While the methodimages()of the first class initialize correctly theLogicalImageinstance to be yield:the method
images()ofPreStdLogicalImageContainerclass and methodopen()of both classes missed to pass the container (self) as first parameter:Initializer of
aff4.LogicalImageexpects the container as first parameter:Just passing
selfas 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.)