Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1342491 - dnf-plugin-spacewalk: dnf-plugin-spacewalk requires both Python 2 and Python 3
Summary: dnf-plugin-spacewalk: dnf-plugin-spacewalk requires both Python 2 and Python 3
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf-plugin-spacewalk
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3 PYTHON3-PYTHON2
TreeView+ depends on / blocked
 
Reported: 2016-06-03 11:40 UTC by Tomas Orsava
Modified: 2017-02-15 20:51 UTC (History)
5 users (show)

Fixed In Version: dnf-plugin-spacewalk-2.6.1-1 dnf-plugin-spacewalk-2.6.3-1.fc25 dnf-plugin-spacewalk-2.6.3-1.fc24
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-14 21:24:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomas Orsava 2016-06-03 11:40:55 UTC
The dnf-plugin-spacewalk RPM requires both Python 2 and Python 3.

Except in very special circumstances, there is no need for one package
to drag in both Python stacks. Usually, this is a packaging error: for
example, a stray "/usr/bin/python" shebang in a Python 3 package can
introduce a Python 2 dependency.

Please split your package, or remove the stray dependencies.
There is a section on shebangs in the Python RPM Porting Guide [0]
which covers this issue.

It's ok to do this in Rawhide only, however, it would be greatly
appreciated if you could push it to Fedora 24 as well.


If anything is unclear, or if you need any kind of assistance, you can
ask on IRC (#fedora-python on Freenode), or reply here. We'll be happy
to help investigating or fixing this issue!


[0] http://python-rpm-porting.readthedocs.io/en/latest/application-modules.html#are-shebangs-dragging-you-down-to-python-2

Comment 1 Miroslav Suchý 2016-06-08 13:32:10 UTC
Note that rhnlib with python3 support just landed in rawhide.

Comment 2 Jan Kurik 2016-07-26 04:47:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.

Comment 3 Dominika Krejčí 2016-09-05 13:59:52 UTC
Hi Michael,
how is it going? Do you need some help?

Comment 4 Michael Mráka 2016-09-23 12:17:13 UTC
Fixed in
commit df2755ff5d0540103814a4f10e8ce648165b922a
    fixed rpmlint warnings
commit 3f4022b51ae602dacc5be09be4624ffc4277c233
    1342491 - remove dependency on python2 on F23+

Comment 5 lau18 2017-01-31 00:52:05 UTC
Hi Michael,

Does dnf-plugin-spacewalk-2.6.1-1 support Fedora 25?  I am getting below stack trace when executing dnf with dnf-plugin-spacewalk-2.4.15-4 on a fedora 25 system (Linux daemon2 4.8.6-300.fc25.x86_64 #1 SMP Tue Nov 1 12:36:38 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux):

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.5/site-packages/dnf/cli/main.py", line 174, in user_main
    errcode = main(args)
  File "/usr/lib/python3.5/site-packages/dnf/cli/main.py", line 60, in main
    return _main(base, args)
  File "/usr/lib/python3.5/site-packages/dnf/cli/main.py", line 93, in _main
    cli.configure(list(map(ucd, args)))
  File "/usr/lib/python3.5/site-packages/dnf/cli/cli.py", line 1048, in configure
    self.base._plugins.run_config()
  File "/usr/lib/python3.5/site-packages/dnf/plugin.py", line 82, in fn
    dnf.util.mapall(operator.methodcaller(method), self.plugins)
  File "/usr/lib/python3.5/site-packages/dnf/util.py", line 183, in mapall
    return list(map(fn, *seq))
  File "/usr/lib/python3.5/site-packages/dnf-plugins/spacewalk.py", line 82, in config
    self.activate_channels(self.cli.demands.sack_activation)
  File "/usr/lib/python3.5/site-packages/dnf-plugins/spacewalk.py", line 137, in activate_channels
    for (channel_id, channel_dict) in enabled_channels.iteritems():

Comment 6 Michael Mráka 2017-01-31 10:12:36 UTC
What command do you exactly run? What's the error message (the very last lines from traceback which are missing from you previous comment)?

Comment 7 lau18 2017-01-31 17:45:56 UTC
(In reply to Michael Mráka from comment #6)
> What command do you exactly run? What's the error message (the very last
> lines from traceback which are missing from you previous comment)?

After installing the dnf-plugin-spacewalk and others, any subsequent dnf commands failed.  The last successful dnf execution was this in the kickstart file during a build:
  # dnf -y install dnf-plugin-spacewalk rhnlib rhn-check rhn-setup rhn-client-tools python3-rhnlib

Then the subsequent dnf resulted the stack trace that followed:
  # dnf -y install yum-plugin-changelog yum-plugin-versionlock


This system is receiving updates from Spacewalk server.
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.5/site-packages/dnf/cli/main.py", line 174, in user_main
    errcode = main(args)
  File "/usr/lib/python3.5/site-packages/dnf/cli/main.py", line 60, in main
    return _main(base, args)
  File "/usr/lib/python3.5/site-packages/dnf/cli/main.py", line 93, in _main
    cli.configure(list(map(ucd, args)))
  File "/usr/lib/python3.5/site-packages/dnf/cli/cli.py", line 1048, in configure
    self.base._plugins.run_config()
  File "/usr/lib/python3.5/site-packages/dnf/plugin.py", line 82, in fn
    dnf.util.mapall(operator.methodcaller(method), self.plugins)
  File "/usr/lib/python3.5/site-packages/dnf/util.py", line 183, in mapall
    return list(map(fn, *seq))
  File "/usr/lib/python3.5/site-packages/dnf-plugins/spacewalk.py", line 82, in config
    self.activate_channels(self.cli.demands.sack_activation)
  File "/usr/lib/python3.5/site-packages/dnf-plugins/spacewalk.py", line 137, in activate_channels
    for (channel_id, channel_dict) in enabled_channels.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'

yum plugin changelog installed


Here we have the last dnf installation information and the plugin config file used to communicate with RedHat Satellite 5.6:

root@daemon2 tmp]# rpm -qa |grep dnf-plugin
python3-dnf-plugins-core-0.1.21-4.fc25.noarch
dnf-plugins-core-0.1.21-4.fc25.noarch
dnf-plugin-spacewalk-2.4.15-4.fc25.noarch
[root@daemon2 tmp]# rpm -qa |grep rhn-
rhn-client-tools-2.5.16-1.fc25.noarch
rhn-setup-2.5.16-1.fc25.noarch
rhn-check-2.5.16-1.fc25.noarch
[root@daemon2 tmp]# rpm -qa |grep python3-rhnlib
python3-rhnlib-2.5.87-2.fc25.noarch

[root@daemon2 tmp]# cat /etc/dnf/plugins/spacewalk.conf
[main]
enabled = 1
gpgcheck = 1
timeout = 120

# You can specify options per channel, e.g.:
#
#[rhel-i386-server-5]
#enabled = 1
#
#[some-unsigned-custom-channel]
#gpgcheck = 0
[root@daemon2 tmp]#

Thanks.

Comment 8 lau18 2017-01-31 17:49:01 UTC
(In reply to lau18 from comment #7)
> (In reply to Michael Mráka from comment #6)
> > What command do you exactly run? What's the error message (the very last
> > lines from traceback which are missing from you previous comment)?
> 
> After installing the dnf-plugin-spacewalk and others, any subsequent dnf
> commands failed.  The last successful dnf execution was this in the
> kickstart file during a build:
>   # dnf -y install dnf-plugin-spacewalk rhnlib rhn-check rhn-setup
> rhn-client-tools python3-rhnlib
> 
> Then the subsequent dnf resulted the stack trace that followed:
>   # dnf -y install yum-plugin-changelog yum-plugin-versionlock
> 
> 
> This system is receiving updates from Spacewalk server.
> 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.5/site-packages/dnf/cli/main.py", line 174, in
> user_main
>     errcode = main(args)
>   File "/usr/lib/python3.5/site-packages/dnf/cli/main.py", line 60, in main
>     return _main(base, args)
>   File "/usr/lib/python3.5/site-packages/dnf/cli/main.py", line 93, in _main
>     cli.configure(list(map(ucd, args)))
>   File "/usr/lib/python3.5/site-packages/dnf/cli/cli.py", line 1048, in
> configure
>     self.base._plugins.run_config()
>   File "/usr/lib/python3.5/site-packages/dnf/plugin.py", line 82, in fn
>     dnf.util.mapall(operator.methodcaller(method), self.plugins)
>   File "/usr/lib/python3.5/site-packages/dnf/util.py", line 183, in mapall
>     return list(map(fn, *seq))
>   File "/usr/lib/python3.5/site-packages/dnf-plugins/spacewalk.py", line 82,
> in config
>     self.activate_channels(self.cli.demands.sack_activation)
>   File "/usr/lib/python3.5/site-packages/dnf-plugins/spacewalk.py", line
> 137, in activate_channels
>     for (channel_id, channel_dict) in enabled_channels.iteritems():
> AttributeError: 'dict' object has no attribute 'iteritems'
> 
> yum plugin changelog installed
> 
> 
> Here we have the last dnf installation information and the plugin config
> file used to communicate with RedHat Satellite 5.6:
> 
> root@daemon2 tmp]# rpm -qa |grep dnf-plugin
> python3-dnf-plugins-core-0.1.21-4.fc25.noarch
> dnf-plugins-core-0.1.21-4.fc25.noarch
> dnf-plugin-spacewalk-2.4.15-4.fc25.noarch
> [root@daemon2 tmp]# rpm -qa |grep rhn-
> rhn-client-tools-2.5.16-1.fc25.noarch
> rhn-setup-2.5.16-1.fc25.noarch
> rhn-check-2.5.16-1.fc25.noarch
> [root@daemon2 tmp]# rpm -qa |grep python3-rhnlib
> python3-rhnlib-2.5.87-2.fc25.noarch
> 
> [root@daemon2 tmp]# cat /etc/dnf/plugins/spacewalk.conf
> [main]
> enabled = 1
> gpgcheck = 1
> timeout = 120
> 
> # You can specify options per channel, e.g.:
> #
> #[rhel-i386-server-5]
> #enabled = 1
> #
> #[some-unsigned-custom-channel]
> #gpgcheck = 0
> [root@daemon2 tmp]#
> 
> Thanks.

Please disregard the output as it's just a debug string using echo command:
   yum plugin changelog installed

Comment 10 Fedora Update System 2017-02-06 09:26:50 UTC
dnf-plugin-spacewalk-2.6.3-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-cfc209b1df

Comment 11 Fedora Update System 2017-02-06 09:26:57 UTC
dnf-plugin-spacewalk-2.6.3-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-14fa17d107

Comment 12 lau18 2017-02-06 18:36:52 UTC
Hello Michael,

Does dnf-plugin-spacewalk-2.6.3-1.fc25 include the fix for errors in Comment 7?

  File "/usr/lib/python3.5/site-packages/dnf-plugins/spacewalk.py", line 137, in activate_channels
    for (channel_id, channel_dict) in enabled_channels.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems

Thanks.

Comment 13 Fedora Update System 2017-02-07 02:49:16 UTC
dnf-plugin-spacewalk-2.6.3-1.fc25 has been pushed to the Fedora 25 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-2017-14fa17d107

Comment 14 Michael Mráka 2017-02-07 08:39:46 UTC
> Hello Michael,
> 
> Does dnf-plugin-spacewalk-2.6.3-1.fc25 include the fix for errors in Comment 7?
> 
>   File "/usr/lib/python3.5/site-packages/dnf-plugins/spacewalk.py", line
> 137, in activate_channels
>     for (channel_id, channel_dict) in enabled_channels.iteritems():
> AttributeError: 'dict' object has no attribute 'iteritems
> 
> Thanks.

Yes, it does. For Fedora 25 update has been already pushed to updates-testing.
You can update by

 dnf update dnf-plugin-spacewalk --enablerepo=updates-testing --disableplugin=spacewalk

Comment 15 Fedora Update System 2017-02-07 10:50:11 UTC
dnf-plugin-spacewalk-2.6.3-1.fc24 has been pushed to the Fedora 24 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-2017-cfc209b1df

Comment 16 lau18 2017-02-07 21:31:26 UTC
(In reply to Michael Mráka from comment #14)
> > Hello Michael,
> > 
> > Does dnf-plugin-spacewalk-2.6.3-1.fc25 include the fix for errors in Comment 7?
> > 
> >   File "/usr/lib/python3.5/site-packages/dnf-plugins/spacewalk.py", line
> > 137, in activate_channels
> >     for (channel_id, channel_dict) in enabled_channels.iteritems():
> > AttributeError: 'dict' object has no attribute 'iteritems
> > 
> > Thanks.
> 
> Yes, it does. For Fedora 25 update has been already pushed to
> updates-testing.
> You can update by
> 
>  dnf update dnf-plugin-spacewalk --enablerepo=updates-testing
> --disableplugin=spacewalk

Thanks! The AttributeError has been fixed.  When will the fix be propagated into the fc25 Update?

Comment 17 Michael Mráka 2017-02-08 08:16:46 UTC
> When will the fix be propagated into the fc25 Update?

See https://fedoraproject.org/wiki/Updates_Policy#All_other_updates for detailed description. Basically when 3 people will mark it as worksforme (+3 karma) or after a week.

Comment 18 Fedora Update System 2017-02-14 21:24:36 UTC
dnf-plugin-spacewalk-2.6.3-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 19 Fedora Update System 2017-02-15 20:51:17 UTC
dnf-plugin-spacewalk-2.6.3-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.