Bug 1704871

Summary: TypeError: 'SwigPyObject' object is not iterable
Product: [Fedora] Fedora Reporter: Brian Lane <bcl>
Component: libdnfAssignee: Jaroslav Mracek <jmracek>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 30CC: amatej, dmach, jmracek, jrohel, mblaha, pkratoch, rpm-software-management, sbueno
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libdnf-0.35.1-2.fc30 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-30 01:14:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Brian Lane 2019-04-30 17:30:51 UTC
I'm trying to add module support to lorax-composer, using libdnf via dnf and python.

After I grab the list of modules with:
modules = dbo._moduleContainer.getModulePackages()
latest = dbo._moduleContainer.getLatestModulesPerRepo(STATE_UNKNOWN, modules)

And digging down to the module object I call some of the ModulePackage methods to get details about it.

I can't seem to get python to iterate the result of getModuleDependencies() called on the ModulePackage object. Other methods work just fine.

This one returns:

<Swig Object of type 'std::vector< libdnf::ModuleDependencies,std::allocator< libdnf::ModuleDependencies > > *' at 0x7fd1eb699930> 

But there doesn't seem to be any way to use it in from python.

Note, I've also filed a GH issue for this at - https://github.com/rpm-software-management/libdnf/issues/718

Comment 1 Jaroslav Mracek 2019-05-03 15:21:23 UTC
I created a patch that allows to work with std::vector< libdnf::ModuleDependencies> (https://github.com/rpm-software-management/libdnf/pull/726). Thank you very much for your report.

Comment 2 Fedora Update System 2019-07-04 13:50:18 UTC
FEDORA-2019-58c2d3f1aa has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-58c2d3f1aa

Comment 3 Fedora Update System 2019-07-05 00:45:52 UTC
dnf-4.2.7-1.fc30, libdnf-0.35.1-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-58c2d3f1aa

Comment 4 Fedora Update System 2019-07-23 07:21:13 UTC
FEDORA-2019-672a74d688 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-672a74d688

Comment 5 Fedora Update System 2019-07-24 01:44:11 UTC
dnf-4.2.7-2.fc30, libdnf-0.35.1-2.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-672a74d688

Comment 6 Fedora Update System 2019-07-30 01:14:42 UTC
dnf-4.2.7-2.fc30, libdnf-0.35.1-2.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.