Description of problem: The doc/examples/install_plugin.py example does not work out of box. Version-Release number of selected component (if applicable): Testing on Fedora rawhide with dnf-4.0.10-1.fc30.noarch. How reproducible: Deterministic. Steps to Reproduce: 1. Copy doc/examples/install_plugin.py from dnf master to /usr/lib/python3.7/site-packages/dnf-plugins/foo.py 2. Try to test with dnf foo zsh Actual results: Traceback (most recent call last): File "/usr/bin/dnf", line 58, in <module> main.user_main(sys.argv[1:], exit_code=True) File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 179, in user_main errcode = main(args) File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 64, in main return _main(base, args, cli_class, option_parser_class) File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 95, in _main cli.configure(list(map(ucd, args)), option_parser()) File "/usr/lib/python3.7/site-packages/dnf/cli/cli.py", line 940, in configure self.optparser.print_help(self.command) File "/usr/lib/python3.7/site-packages/dnf/cli/option_parser.py", line 407, in print_help cp = self._command_parser(command) File "/usr/lib/python3.7/site-packages/dnf/cli/option_parser.py", line 341, in _command_parser command.set_argparser(self) File "/usr/lib/python3.7/site-packages/dnf-plugins/foo.py", line 29, in set_argparser parser.add_argument('package', nargs='+', metavar=_('PACKAGE'), NameError: name '_' is not defined Traceback (most recent call last): File "/usr/bin/dnf", line 58, in <module> main.user_main(sys.argv[1:], exit_code=True) File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 179, in user_main errcode = main(args) File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 64, in main return _main(base, args, cli_class, option_parser_class) File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 95, in _main cli.configure(list(map(ucd, args)), option_parser()) File "/usr/lib/python3.7/site-packages/dnf/cli/cli.py", line 940, in configure self.optparser.print_help(self.command) File "/usr/lib/python3.7/site-packages/dnf/cli/option_parser.py", line 407, in print_help cp = self._command_parser(command) File "/usr/lib/python3.7/site-packages/dnf/cli/option_parser.py", line 341, in _command_parser command.set_argparser(self) File "/usr/lib/python3.7/site-packages/dnf-plugins/foo.py", line 30, in set_argparser action=OptionParser.ParseSpecGroupFileCallback, NameError: name 'OptionParser' is not defined Last metadata expiration check: 1:46:16 ago on Fri 18 Jan 2019 05:56:29 AM EST. Traceback (most recent call last): File "/usr/bin/dnf", line 58, in <module> main.user_main(sys.argv[1:], exit_code=True) File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 179, in user_main errcode = main(args) File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 64, in main return _main(base, args, cli_class, option_parser_class) File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 99, in _main return cli_run(cli, base) File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 115, in cli_run cli.run() File "/usr/lib/python3.7/site-packages/dnf/cli/cli.py", line 1107, in run return self.command.run() File "/usr/lib/python3.7/site-packages/dnf-plugins/foo.py", line 44, in run self.base.package_install(self.base.add_remote_rpms(self.opts.package, strict=False)) File "/usr/lib/python3.7/site-packages/dnf/base.py", line 1891, in package_install q = self.sack.query()._nevra(pkg.name, pkg.evr, pkg.arch) AttributeError: 'list' object has no attribute 'name' Expected results: No errors, the example does something useful. Additional info: Fix for the first two tracebacks is in https://github.com/rpm-software-management/dnf/pull/1304. But I have no idea how the self.base.package_install(self.base.add_remote_rpms(self.opts.package, strict=False)) line should work or what it's supposed to do.
PR https://github.com/rpm-software-management/dnf/pull/1306
libcomps-0.1.10-2.fc29 libdnf-0.26.0-1.fc29 dnf-plugins-core-4.0.4-1.fc29 dnf-plugins-extras-4.0.2-1.fc29 dnf-4.1.0-1.fc29 librepo-1.9.4-1.fc29 createrepo_c-0.12.1-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-1fccede810
createrepo_c-0.12.1-1.fc29, dnf-4.1.0-1.fc29, dnf-plugins-core-4.0.4-1.fc29, dnf-plugins-extras-4.0.2-1.fc29, libcomps-0.1.10-2.fc29, libdnf-0.26.0-1.fc29, librepo-1.9.4-1.fc29 has been pushed to the Fedora 29 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-1fccede810
createrepo_c-0.12.1-1.fc29, dnf-4.1.0-1.fc29, dnf-plugins-core-4.0.4-1.fc29, dnf-plugins-extras-4.0.2-1.fc29, libcomps-0.1.10-2.fc29, libdnf-0.26.0-1.fc29, librepo-1.9.4-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.