Bug 1421732

Summary: imgbase base --remove does not remove child layers
Product: [oVirt] ovirt-node Reporter: Roman Hodain <rhodain>
Component: GeneralAssignee: Yuval Turgeman <yturgema>
Status: CLOSED DUPLICATE QA Contact: cshao <cshao>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.0CC: bugs, cshao, dguo, huzhao, jiawu, qiyuan, rbarry, sbonazzo, weiwang, yaniwang, ycui, yzhao
Target Milestone: ovirt-4.1.2Flags: rule-engine: ovirt-4.1?
rhodain: planning_ack?
rhodain: devel_ack?
cshao: testing_ack+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1421699 Environment:
Last Closed: 2017-02-14 08:07:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Node RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
lvs taken before the removal
none
lvs taken after the removal
none
imgbase debug logs none

Description Roman Hodain 2017-02-13 14:45:38 UTC
Description of problem:

    imgbase base --remove=<BASE> doe not remove child layers.

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

How reproducible:
    100%

Steps to Reproduce:
    1. imgbase base --remove=<BASE>

Actual results:
Child layer is not removed and other commands fails due to this inconsistency:

     # imgbase --debug base --remove=rhvh-4.0-0.20161116.0

     # imgbase base --latest
            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 137, in post_argparse
                print(app.imgbase.latest_base())
            File "/usr/lib/python2.7/site-packages/imgbased/imgbase.py", line 322, in latest_base
                return self.naming.last_base()
            File "/usr/lib/python2.7/site-packages/imgbased/naming.py", line 62, in last_base
                bases = self.bases()
            File "/usr/lib/python2.7/site-packages/imgbased/naming.py", line 50, in bases
                bases = sorted(self.tree())
            File "/usr/lib/python2.7/site-packages/imgbased/naming.py", line 224, in tree
                bases[img.base.nvr].layers.append(img)
            KeyError: <NVR rhvh-4.0-0.20161116.0 />


Expected results:
    The base is removed including its layers

Comment 1 Roman Hodain 2017-02-13 14:46:46 UTC
Created attachment 1249875 [details]
lvs taken before the removal

Comment 2 Roman Hodain 2017-02-13 14:47:12 UTC
Created attachment 1249876 [details]
lvs taken after the removal

Comment 3 Roman Hodain 2017-02-13 14:47:41 UTC
Created attachment 1249877 [details]
imgbase debug logs

Comment 4 cshao 2017-02-14 06:57:15 UTC
QE can reproduce this issue.

Comment 5 Yuval Turgeman 2017-02-14 08:07:22 UTC

*** This bug has been marked as a duplicate of bug 1419535 ***