Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1364042 - Command "imgbase layout" fail when login with non-root account.
Summary: Command "imgbase layout" fail when login with non-root account.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-node
Classification: oVirt
Component: UI
Version: 4.0
Hardware: Unspecified
OS: Unspecified
medium
medium vote
Target Milestone: ovirt-4.1.0-beta
: 4.1
Assignee: Yuval Turgeman
QA Contact: Wei Wang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-04 11:24 UTC by Wei Wang
Modified: 2017-02-01 14:47 UTC (History)
9 users (show)

Fixed In Version: imgbased-0.9.3-0.1.el7ev
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-01 14:47:36 UTC
oVirt Team: Node
rule-engine: ovirt-4.1+
rule-engine: planning_ack+
fdeutsch: devel_ack+
ycui: testing_ack+


Attachments (Terms of Use)
ks file (deleted)
2016-08-04 11:24 UTC, Wei Wang
no flags Details
log files (deleted)
2016-08-04 11:25 UTC, Wei Wang
no flags Details


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 68688 master MERGED Making sure imgbase runs as root 2017-01-05 14:27:54 UTC
oVirt gerrit 69714 ovirt-4.1 MERGED Making sure imgbase runs as root 2017-01-05 14:28:18 UTC

Description Wei Wang 2016-08-04 11:24:08 UTC
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!

Comment 1 Wei Wang 2016-08-04 11:25:00 UTC
Created attachment 1187444 [details]
log files

Comment 2 Fabian Deutsch 2016-08-29 16:08:59 UTC
To make it right, we should probably use polkit to gain root privileges.

Comment 3 Fabian Deutsch 2016-09-23 07:42:32 UTC
… or move imgbased to sbin

Comment 4 Sandro Bonazzola 2017-01-10 10:09:27 UTC
shouldn't this be on modified?

Comment 5 Wei Wang 2017-01-17 02:56:41 UTC
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.


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