Created attachment 1187443 [details] ks file Description of problem: Command "imgbase layout" fail when login with non-root account. Version-Release number of selected component (if applicable): redhat-virtualization-host-4.0-20160803.3.x86_64 imgbased-0.7.4-0.1.el7ev.noarch How reproducible: 100% Steps to Reproduce: 1. Install redhat-virtualization-host-4.0-20160727.1.x86_64 with kickstart file in attachment 2. Login with non-root account weiwang 3. Input "imgbase layout" command, then check Actual results: Command "imgbase layout" fail when login with non-root account. Traceback (most recent call last): File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/usr/lib/python2.7/site-packages/imgbased/__main__.py", line 42, in <module> CliApplication() File "/usr/lib/python2.7/site-packages/imgbased/__init__.py", line 80, in CliApplication app.hooks.emit("post-arg-parse", args) File "/usr/lib/python2.7/site-packages/imgbased/hooks.py", line 120, in emit cb(self.context, *args) File "/usr/lib/python2.7/site-packages/imgbased/plugins/core.py", line 171, in post_argparse print(layout.dumps()) File "/usr/lib/python2.7/site-packages/imgbased/plugins/core.py", line 199, in dumps return self.app.imgbase.layout() File "/usr/lib/python2.7/site-packages/imgbased/imgbase.py", line 138, in layout return self.naming.layout() File "/usr/lib/python2.7/site-packages/imgbased/naming.py", line 109, in layout tree = self.tree(lvs) File "/usr/lib/python2.7/site-packages/imgbased/naming.py", line 205, in tree names = datasource() File "/usr/lib/python2.7/site-packages/imgbased/imgbase.py", line 84, in list_our_lv_names lvs = LVM.list_lvs() File "/usr/lib/python2.7/site-packages/imgbased/lvm.py", line 52, in list_lvs lvs = [cls.LV.from_lvm_name(n) for n in cls._list_lv_full_names()] File "/usr/lib/python2.7/site-packages/imgbased/lvm.py", line 182, in from_lvm_name return cls.from_lv_name(*lvm_name.split("/")) TypeError: from_lv_name() takes exactly 3 arguments (5 given) Expected results: Command "imgbase layout" should be successful when login with non-root account. rhvh-4.0-0.20160803.0 +- rhvh-4.0-0.20160803.0+1 Additional info: If this command is not support by non-root account, the output should like be: imgbase must be run as root!
Created attachment 1187444 [details] log files
To make it right, we should probably use polkit to gain root privileges.
… or move imgbased to sbin
shouldn't this be on modified?
Test Version: redhat-virtualization-host-4.1-20170116.0 imgbased-0.9.4-0.1.el7ev.noarch Steps: 1. Install redhat-virtualization-host-4.1-20170116.0 2. Login with non-root account 3. Input "imgbase layout" command, then check Results: $ imgbase layout imgbase must be run as root! The bug cannot be reproduced, change status to VERIFIED.