Bug 991614 - Content Units removed from repository remain as symlinks in published dir
Summary: Content Units removed from repository remain as symlinks in published dir
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: user-experience
Version: 2.2 Beta
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
: 2.4.0
Assignee: Mike McCune
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-02 23:24 UTC by Ryan Bowlby
Modified: 2014-08-09 06:55 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-09 06:55:06 UTC
Embargoed:


Attachments (Terms of Use)

Description Ryan Bowlby 2013-08-02 23:24:04 UTC
Description of problem:

Removing a content unit (RPM) from a pulp repository does not appear to remove the existing symlink within the published directory. Listing content for that repo shows the content to have been successfully removed. Unfortunately, the content symlink in the repo remains.


Version-Release number of selected component (if applicable):


2.2.0-0.20.beta.el6


How reproducible:


Steps to Reproduce:
1. add an RPM to a pulp repo (no feed/origin) using pulp-admin
2. publish repo
3. confirm existence in published dir within browser
4. remove content unit from repo using API (possibly via cli as well, didn't test)
5. publish
6. package remains in published dir


Actual results:

package remains in published dir as symlink after removal of content from repo 

Expected results:

package removed from pub dir

Additional info:


The API calls being made:

def copy_package(package, src_repo, dst_repo):
    body = {
      'source_repo_id' : src_repo,
      'criteria': {
        'type_ids' : ['rpm'],
        'filters' : {
          'unit' : {
            '$and': [{'filename': package }]
          }
        }
      },
     'override_config': {
       'resolve_dependencies': True,
       'recursive': True
      },
    }

    path = "/repositories/%s/actions/associate/" % dst_repo
    resp = post(path,body)
    if resp.status_code in range(200,299):
        return True
    else:
        raise ConveyorException("unable to copy %s from %s to %s" % (package, src_repo, dst_repo))



def unassociate_package(package, repo):
    body = {
      "criteria": {
        "type_ids": ["rpm"],
        "filters": {
          'unit' : { 'filename': package }
        },
      }
    }
    path = "/repositories/%s/actions/unassociate/" % (repo)
    resp = post(path,body)
    if resp.status_code in range(200,299):
        return True
    else:
        raise ConveyorException("unable to unassociate %s from %s." % (package, repo))



def move_package(package, src_repo, dst_repo):
    copy_package(package, src_repo, dst_repo)
    unassociate_package(package, src_repo)

Comment 1 Ryan Bowlby 2013-08-09 16:02:18 UTC
Seems like this should be a simple fix (for the right person). Just a minor addition to the publish logic that removes symlinks to content units not listed...right? Waiting till 2.4 for proper deletion of RPMs seems strange.

Comment 2 Jason Connor 2013-11-19 21:24:13 UTC
Part of the new yum distributor

Comment 4 Jeff Ortel 2014-04-03 13:36:12 UTC
build: 2.4.0-0.7.beta

Comment 5 Preethi Thomas 2014-04-15 18:18:03 UTC
verified

[root@pulp-24-server ~]# rpm -qa pulp-server
pulp-server-2.4.0-0.9.beta.el6.noarch
[root@pulp-24-server ~]#

Comment 6 Randy Barlow 2014-08-09 06:55:06 UTC
This has been fixed in Pulp 2.4.0-1.


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