Bug 991614 - Content Units removed from repository remain as symlinks in published dir
Content Units removed from repository remain as symlinks in published dir
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: user-experience (Show other bugs)
2.2 Beta
Unspecified Unspecified
medium Severity unspecified
: ---
: 2.4.0
Assigned To: Mike McCune
Preethi Thomas
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-02 19:24 EDT by Ryan Bowlby
Modified: 2014-08-09 02:55 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-09 02:55:06 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ryan Bowlby 2013-08-02 19:24:04 EDT
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 12:02:18 EDT
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 16:24:13 EST
Part of the new yum distributor
Comment 4 Jeff Ortel 2014-04-03 09:36:12 EDT
build: 2.4.0-0.7.beta
Comment 5 Preethi Thomas 2014-04-15 14:18:03 EDT
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 02:55:06 EDT
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.