Bug 847395 - Yum importer's remove_units implementation raises an error
Yum importer's remove_units implementation raises an error
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: user-experience (Show other bugs)
2.0.6
Unspecified Unspecified
unspecified Severity unspecified
: ---
: Sprint 39
Assigned To: Jay Dobies
Preethi Thomas
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-10 16:39 EDT by Jay Dobies
Modified: 2013-09-09 12:38 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-09 12:09:21 EST
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 Jay Dobies 2012-08-10 16:39:04 EDT
It looks like it hasn't been updated to reflect the filename isn't in the unit key anymore.

2012-08-10 16:37:34,802 14450:140622220470016: pulp.server.managers.repo.unit_association:ERROR: unit_association:473 Exception from importer [yum_importer] while removing units from repo [avengers]
Traceback (most recent call last):
  File "/home/jdob/code/pulp/platform/src/pulp/server/managers/repo/unit_association.py", line 471, in remove_from_importer
    importer_instance.remove_units(transfer_repo, transfer_units, call_config)
  File "/usr/lib/pulp/plugins/importers/yum_importer/importer.py", line 321, in remove_units
    sym_link = os.path.join(repo.working_dir, repo.id, u.unit_key["filename"])
KeyError: 'filename'
Comment 1 Pradeep Kilambi 2012-08-14 11:09:53 EDT
fixed commit d14e6cd3a56be5533a02920de03360f05a035a94

fixed the filename lookup. The task now succeeds and removes the symlink. But there is still an issue pickling args

2012-08-14 10:57:13,980 11958:139813558658816: pulp.plugins.yum_importer.importer:INFO: importer:318 remove_units invoked for 1 units
2012-08-14 10:57:13,981 11958:139813558658816: pulp.server.dispatch.task:INFO: task:148 Task 5510b123-e620-11e1-b868-24770342b0c0: CallRequest: RepoUnitAssociationManager.unassociate_by_criteria(u'testremove', {'unit_sort': None, 'association_filters': {}, '_id': ObjectId('502a67499d512b2eb6000021'), 'remove_duplicates': False, 'skip': None, 'association_fields': None, 'unit_filters': {'_id': {'$in': [u'5fef0588-dea7-4a94-9cfd-41923b7b6930']}, u'name': {u'$regex': u'zsh'}}, 'association_sort': None, 'unit_fields': None, 'limit': None, 'type_ids': [u'rpm'], 'id': '502a67499d512b2eb6000021'}, 'user', u'admin') SUCCEEDED
2012-08-14 10:57:13,988 11958:139813558658816: pulp.server.dispatch.call:ERROR: call:191 Exception encountered while pickling: args
2012-08-14 10:57:13,989 11958:139813558658816: pulp.server.dispatch.call:ERROR: call:192 'NoneType' object is not callable
Traceback (most recent call last):
  File "/home/pkilambi/code/pulp/platform/src/pulp/server/dispatch/call.py", line 187, in serialize
    data[field] = pickle.dumps(getattr(self, field))
  File "/usr/lib64/python2.7/pickle.py", line 1374, in dumps
    Pickler(file, protocol).dump(obj)
  File "/usr/lib64/python2.7/pickle.py", line 224, in dump
    self.save(obj)
  File "/usr/lib64/python2.7/pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/lib64/python2.7/pickle.py", line 600, in save_list
    self._batch_appends(iter(obj))
  File "/usr/lib64/python2.7/pickle.py", line 615, in _batch_appends
    save(x)
  File "/usr/lib64/python2.7/pickle.py", line 306, in save
    rv = reduce(self.proto)
  File "/usr/lib64/python2.7/copy_reg.py", line 84, in _reduce_ex
    dict = getstate()
TypeError: 'NoneType' object is not callable
Comment 2 Jay Dobies 2012-09-04 16:43:26 EDT
Moving to MODIFIED. That other exception is a red herring and is tracked in another bug.
Comment 3 Jeff Ortel 2012-09-11 09:31:35 EDT
build: 0.327
Comment 4 Jay Dobies 2012-11-06 12:24:32 EST
To verify, upload an RPM and use the CLI to remove it. If you don't get an error, you're good to go.
Comment 5 Preethi Thomas 2012-11-07 15:11:13 EST
verified
[root@preethi oauth]# pulp-admin rpm repo uploads rpm  --repo-id upload2 --dir /tmp/uploads/
+----------------------------------------------------------------------+
                          Puppet Module Upload
+----------------------------------------------------------------------+

Extracting necessary metdata for each request...
[==================================================] 100%
Analyzing: pulp-large_1mb_test-packageA-0.1.1-1.fc14.noarch.rpm
... completed

Creating upload requests on the server...
[==================================================] 100%
Initializing: pulp-large_1mb_test-packageA-0.1.1-1.fc14.noarch.rpm
... completed

Starting upload of selected packages. If this process is stopped through ctrl+c,
the uploads will be paused and may be resumed later using the resume command or
cancelled entirely using the cancel command.

Uploading: grinder-0.1.5-2.fc17.noarch.rpm
[==================================================] 100%
148189/148189 bytes
... completed

Importing into the repository...
... completed

Deleting the upload request...
... completed

Uploading: pulp-large_1mb_test-packageB-0.1.1-1.fc14.noarch.rpm
[==================================================] 100%
1051164/1051164 bytes
... completed

Importing into the repository...
... completed

Deleting the upload request...
... completed

Uploading: gofer-0.71-1.fc17.noarch.rpm
[==================================================] 100%
67969/67969 bytes
... completed

Importing into the repository...
... completed

Deleting the upload request...
... completed

Uploading: pulp-large_1mb_test-packageA-0.1.1-1.fc14.noarch.rpm
[==================================================] 100%
1051164/1051164 bytes
... completed

Importing into the repository...
... completed

Deleting the upload request...
... completed

[root@preethi oauth]# pulp-admin repo list
+----------------------------------------------------------------------+
                              Repositories
+----------------------------------------------------------------------+

Id:                 zoo
Display Name:       zoo
Description:        None
Content Unit Count: 32

Id:                 scientific
Display Name:       scientific
Description:        None
Content Unit Count: 515

Id:                 puppet-repo1
Display Name:       puppet-repo1
Description:        None
Content Unit Count: 0

Id:                 pulp
Display Name:       pulp
Description:        None
Content Unit Count: 35

Id:                 upload
Display Name:       upload
Description:        None
Content Unit Count: 2

Id:                 upload2
Display Name:       upload2
Description:        None
Content Unit Count: 4

Id:                 upload4
Display Name:       upload4
Description:        None
Content Unit Count: 0


[root@preethi oauth]# pulp-admin rpm repo remove rpm --repo-id upload2 --str-eq='name=pulp-large_1mb_test-packageB'
Progress on this task can be viewed using the commands under "repo tasks".

[root@preethi oauth]# pulp-admin repo list
+----------------------------------------------------------------------+
                              Repositories
+----------------------------------------------------------------------+

Id:                 zoo
Display Name:       zoo
Description:        None
Content Unit Count: 32

Id:                 scientific
Display Name:       scientific
Description:        None
Content Unit Count: 515

Id:                 puppet-repo1
Display Name:       puppet-repo1
Description:        None
Content Unit Count: 0

Id:                 pulp
Display Name:       pulp
Description:        None
Content Unit Count: 35

Id:                 upload
Display Name:       upload
Description:        None
Content Unit Count: 2

Id:                 upload2
Display Name:       upload2
Description:        None
Content Unit Count: 3

Id:                 upload4
Display Name:       upload4
Description:        None
Content Unit Count: 0


[root@preethi oauth]#
Comment 6 Preethi Thomas 2013-01-09 12:09:21 EST
Pulp v2.0 released

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