Bug 1421699 - imgbase base --of-layer fails with exception when base is provided.
Summary: imgbase base --of-layer fails with exception when base is provided.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-node
Classification: oVirt
Component: General
Version: 4.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ovirt-4.1.1
: 4.1
Assignee: Yuval Turgeman
QA Contact: cshao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-13 13:21 UTC by Roman Hodain
Modified: 2017-04-21 09:52 UTC (History)
11 users (show)

Fixed In Version: imgbased-0.9.11-0.1.el7ev
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1421732 (view as bug list)
Environment:
Last Closed: 2017-04-21 09:52:52 UTC
oVirt Team: Node
Embargoed:
rule-engine: ovirt-4.1+
rule-engine: planning_ack+
sbonazzo: devel_ack+
cshao: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 72398 0 master MERGED Checking for layer existence in base_of_layer 2017-02-21 16:34:07 UTC
oVirt gerrit 72800 0 ovirt-4.1 MERGED Checking for layer existence in base_of_layer 2017-02-21 16:34:53 UTC

Description Roman Hodain 2017-02-13 13:21:57 UTC
Description of problem:
imgbase base --of-layer fails with exception when base is provided instead of a layer.

Version-Release number of selected component (if applicable):
imgbased-0.8.11-0.1.el7ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. base --of-layer <BASE>

Actual results:
imgbase base --of-layer rhvh-4.0-0.20170104.0
Base
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 51, in <module>
    CliApplication()
  File "/usr/lib/python2.7/site-packages/imgbased/__init__.py", line 82, 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 139, in post_argparse
    print(str(app.imgbase.base_of_layer(args.of_layer)))
  File "/usr/lib/python2.7/site-packages/imgbased/imgbase.py", line 339, in base_of_layer
    return Image.from_nvr(layer).base
AttributeError: 'Base' object has no attribute 'base'


Expected results:
An error message is provided or the same base is reported back.

Additional info:
# imgbase base --of-layer rhvh-4.0-0.20170104.0+1
rhvh-4.0-0.20170104.0


# imgbase base --of-layer rhvh-4.0-0.20170104.0
Base
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 51, in <module>
    CliApplication()
  File "/usr/lib/python2.7/site-packages/imgbased/__init__.py", line 82, 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 139, in post_argparse
    print(str(app.imgbase.base_of_layer(args.of_layer)))
  File "/usr/lib/python2.7/site-packages/imgbased/imgbase.py", line 339, in base_of_layer
    return Image.from_nvr(layer).base
AttributeError: 'Base' object has no attribute 'base'

Base class does not have a base object so when the base is detected instead of layer the exception is raised.

Comment 1 cshao 2017-02-14 06:52:43 UTC
QE can reproduce this issue.

Comment 2 cshao 2017-02-28 07:10:26 UTC
Test version:
redhat-virtualization-host-4.1-20170222.0
imgbased-0.9.13-0.1.el7ev.noarch

Test step:
# imgbase w
[INFO] You are on rhvh-4.1-0.20170223.0+1
# imgbase base --of-layer rhvh-4.1-0.20170223.0+1
rhvh-4.1-0.20170223.0
# 

Test result:
imgbase base --of-layer  -  pass

So the bug is fixed, change bug status to VERIFIED.


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