Bug 1297511 - noroot configure causes a traceback when plugins are loaded without a cli
noroot configure causes a traceback when plugins are loaded without a cli
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf-plugins-core (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-11 12:56 EST by David Shea
Modified: 2016-02-16 23:22 EST (History)
6 users (show)

See Also:
Fixed In Version: dnf-plugins-core-0.1.16-1.fc23 dnf-plugins-core-0.1.16-1.fc22
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-16 23:22:53 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Shea 2016-01-11 12:56:10 EST
Description of problem:
File "/usr/lib/python3.5/site-packages/dnf-plugins/noroot.py", line 41, in config
  if not self.cli.demands.root_user:
AttributeError: 'NoneType' object has no attribute 'demands'

dnf.plugins.Plugins.run_init defaults to None for the cli argument, but actually using None causes an error in noroot.

Version-Release number of selected component (if applicable):
python3-dnf-plugins-core-0.1.15-1.fc24.noarch


Additional info:
diff --git a/plugins/noroot.py b/plugins/noroot.py
index f82b6a3..f6a583e 100644
--- a/plugins/noroot.py
+++ b/plugins/noroot.py
@@ -38,7 +38,7 @@ class Noroot(dnf.Plugin):
         self.cli = cli
 
     def config(self):
-        if not self.cli.demands.root_user:
+        if not self.cli or not self.cli.demands.root_user:
             return
         if os.geteuid() == 0:
             return


should work.
Comment 1 Honza Silhan 2016-01-19 09:19:36 EST
PR: https://github.com/rpm-software-management/dnf-plugins-core/pull/143

thanks.
Comment 2 Fedora Update System 2016-01-26 05:34:02 EST
dnf-plugins-core-0.1.16-1.fc23 dnf-1.1.6-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-80cbf309b4
Comment 3 Fedora Update System 2016-01-26 05:35:26 EST
dnf-plugins-core-0.1.16-1.fc22 dnf-1.1.6-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-573eba7b37
Comment 4 Fedora Update System 2016-01-26 14:52:30 EST
dnf-1.1.6-1.fc23, dnf-plugins-core-0.1.16-1.fc23 has been pushed to the Fedora 23 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-2016-80cbf309b4
Comment 5 Fedora Update System 2016-01-28 13:19:47 EST
dnf-1.1.6-1.fc23, dnf-plugins-core-0.1.16-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.
Comment 6 Fedora Update System 2016-01-28 18:19:08 EST
dnf-1.1.6-1.fc22, dnf-plugins-core-0.1.16-1.fc22 has been pushed to the Fedora 22 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-2016-573eba7b37
Comment 7 Fedora Update System 2016-02-03 08:06:03 EST
dnf-1.1.6-2.fc22 dnf-plugins-core-0.1.16-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-573eba7b37
Comment 8 Fedora Update System 2016-02-03 18:26:38 EST
dnf-1.1.6-2.fc22, dnf-plugins-core-0.1.16-1.fc22 has been pushed to the Fedora 22 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-2016-573eba7b37
Comment 9 Fedora Update System 2016-02-16 23:21:58 EST
dnf-1.1.6-2.fc22, dnf-plugins-core-0.1.16-1.fc22 has been pushed to the Fedora 22 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.