Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError enumerating images a PreStdLogicalImageContainer #11

Open
gonmator opened this issue Aug 14, 2019 · 0 comments
Open

TypeError enumerating images a PreStdLogicalImageContainer #11

gonmator opened this issue Aug 14, 2019 · 0 comments

Comments

@gonmator
Copy link
Contributor

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.)

@gonmator gonmator mentioned this issue Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant