Bug 645896 - sync fails if the gpg key is added before repo sync
Summary: sync fails if the gpg key is added before repo sync
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Jeff Ortel
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: pulp-verified
TreeView+ depends on / blocked
 
Reported: 2010-10-22 19:56 UTC by Preethi Thomas
Modified: 2011-08-16 14:01 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-16 14:01:57 UTC
Embargoed:


Attachments (Terms of Use)

Description Preethi Thomas 2010-10-22 19:56:29 UTC
Description of problem:

Steps

1. Create repo with packages with gpg keys
2. Update the repo with --addkeys option
3. run repo sync


root@preethi ~]# pulp-admin repo create --id=repo-gpg --name=repo-gpg --feed=yum:http://atlantis.usersys.redhat.com/content/extras/
Successfully created repository [ repo-gpg ]

[root@preethi ~]# pulp-admin repo update --id=repo-gpg --addkeys=/root/gpg/
uploading /root/gpg/RPM-GPG-KEY-jortel
Successfully updated repository [ repo-gpg ]

[root@preethi ~]# pulp-admin repo sync --id=repo-gpg -FSync for repository repo-gpg started
You can safely CTRL+C this current command and it will continue
[==================================================] 100% (1 of 1 pkgs)
Sync: Error

Traceback (most recent call last):
  File "/usr/bin/pulp-admin", line 104, in <module>
    admin.main()
  File "/usr/lib/python2.6/site-packages/pulp/client/cli/base.py", line 98, in main
    command.main(args[1:])
  File "/usr/lib/python2.6/site-packages/pulp/client/core/base.py", line 105, in main
    action.main(args[1:])
  File "/usr/lib/python2.6/site-packages/pulp/client/core/base.py", line 189, in main
    self.run()
  File "/usr/lib/python2.6/site-packages/pulp/client/core/repo.py", line 387, in run
    self.sync_foreground(task)
  File "/usr/lib/python2.6/site-packages/pulp/client/core/repo.py", line 369, in sync_foreground
    raise SyncError(task['traceback'][-1])
pulp.client.core.repo.SyncError: AttributeError: 'tuple' object has no attribute 'rfind'

[root@preethi ~]#

Comment 1 Preethi Thomas 2010-10-22 20:12:16 UTC
2010-10-22 16:21:51,777 [INFO][Thread-41] unlink() @ keystore.py:162 - unlinking: /var/lib/pulp/gpg/content/extras/RPM-GPG-KEY-jortel
2010-10-22 16:21:51,778 [ERROR][Thread-41] keyfiles() @ keystore.py:135 - /var/lib/pulp/repos/content/extras/packages
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pulp/server/api/keystore.py", line 129, in keyfiles
    f = open(fp)
IOError: [Errno 21] Is a directory: u'/var/lib/pulp/repos/content/extras/packages'
2010-10-22 16:21:51,779 [ERROR][Thread-41] keyfiles() @ keystore.py:135 - /var/lib/pulp/repos/content/extras/repodata
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pulp/server/api/keystore.py", line 129, in keyfiles
    f = open(fp)
IOError: [Errno 21] Is a directory: u'/var/lib/pulp/repos/content/extras/repodata'
2010-10-22 16:21:51,780 [ERROR][Thread-41] failed() @ task.py:205 - Task id:00009af3-de1a-11df-bd37-002564a85a58, method_name:_sync:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pulp/server/tasking/task.py", line 129, in run
    result = self.callable(*self.args, **self.kwargs)
  File "/usr/lib/python2.6/site-packages/pulp/server/api/repo.py", line 838, in _sync
    sync_packages, sync_errataids = repo_sync.sync(repo, repo_source, progress_callback)
  File "/usr/lib/python2.6/site-packages/pulp/server/api/repo_sync.py", line 72, in sync
    synchronizer.add_keys_from_dir(repo_dir, repo)
  File "/usr/lib/python2.6/site-packages/pulp/server/api/repo_sync.py", line 212, in add_keys_from_dir
    keystore.relink()
  File "/usr/lib/python2.6/site-packages/pulp/server/api/keystore.py", line 96, in relink
    fn = os.path.basename(path)
  File "/usr/lib64/python2.6/posixpath.py", line 111, in basename
    i = p.rfind('/') + 1
AttributeError: 'tuple' object has no attribute 'rfind'

Comment 2 Jeff Ortel 2010-10-22 20:17:51 UTC
Fixed: acadebeb53c15a146292165e4635a5edbf2d81dd

Comment 3 Jay Dobies 2010-10-26 14:47:14 UTC
Fixed in build 0.76.

Comment 4 Preethi Thomas 2010-10-27 18:50:05 UTC
verified


[root@preethi ~]#  pulp-admin repo create --id=repo-gpg --name=repo-gpg --feed=yum:http://atlantis.usersys.redhat.com/content/extras/
Successfully created repository [ repo-gpg ]

[root@preethi ~]# pulp-admin repo update --id=repo-gpg --addkeys=/root/gpg/
uploading /root/gpg/RPM-GPG-KEY-jortel
Successfully updated repository [ repo-gpg ]

[root@preethi ~]# pulp-admin repo sync --id=repo-gpg -F
Sync for repository repo-gpg started
You can safely CTRL+C this current command and it will continue
[==================================================] 100% (1 of 1 pkgs)
Sync: Finished

[root@preethi ~]#  pulp-admin repo sync --id=repo-gpg -F
Sync for repository repo-gpg started
You can safely CTRL+C this current command and it will continue
[==================================================] 100% (1 of 1 pkgs)
Sync: Finished

[root@preethi ~]# pulp-admin repo listkeys --id=repo-gpg 
RPM-GPG-KEY-jortel

Comment 5 Preethi Thomas 2011-08-16 14:01:57 UTC
Closing with Community Release 15

pulp-0.0.223-4.


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