Bug 677662 - ServicesConnection.upload() should not throw an exception when uploaded package exists
Summary: ServicesConnection.upload() should not throw an exception when uploaded packa...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: Sprint 21
Assignee: Pradeep Kilambi
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: 563609 verified-to-close
TreeView+ depends on / blocked
 
Reported: 2011-02-15 14:18 UTC by Daniel Mach
Modified: 2011-08-16 12:22 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-08-16 12:11:26 UTC
Embargoed:


Attachments (Terms of Use)

Description Daniel Mach 2011-02-15 14:18:57 UTC
When re-uploading existing package, an exception is thrown.
This exception doesn't contain any information other than a traceback text.
I think server should return an error code (and message) instead so client can act properly.

sconn = pulp.client.connection.ServicesConnection()
sconn.upload(...)

This is *text*, not actual exception instance:
500: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/base.py", line 52, in report_error
    return method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/compat.py", line 40, in _decorator
    return decorator(*args,**kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/base.py", line 124, in _auth_decorator
    value = method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/services.py", line 61, in POST
    return self.ok(papi.upload(data['pkginfo'], data['pkgstream']))
  File "/usr/lib/python2.7/site-packages/pulp/server/api/package.py", line 230, in upload
    raise pae
PackageAlreadyExists: Package testpkg-1-1.el5.noarch.rpm Already Exists on the server with checksum [2f77b988b8c85eb7c09832bbe4b5fb9514b1c0231bd4d19936f6c01f3f2b1e3d]; skipping upload.

Comment 1 Pradeep Kilambi 2011-02-23 15:09:20 UTC
fixed this as part of upload rewrite.

Comment 2 Jeff Ortel 2011-02-23 17:59:58 UTC
Build: 0.141

Comment 3 Preethi Thomas 2011-03-07 20:04:32 UTC
verified

[root@preethi ~]# rpm -q pulp
pulp-0.0.144-1.fc14.noarch

[root@preethi ~]# pulp-admin content upload -r upload2 /root/upload/gofer-0.20-1.fc14.noarch.rpm  -v 
* Starting Package Upload

* Performing Package Uploads to Pulp server
Package [/root/upload/gofer-0.20-1.fc14.noarch.rpm] is not signed. Please use --nosig. Skipping 
No applicable content to associate.
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# pulp-admin content upload -r upload2 /root/upload/gofer-0.20-1.fc14.noarch.rpm  --nosig -v 
* Starting Package Upload

* Performing Package Uploads to Pulp server
Successfully uploaded [gofer-0.20-1.fc14.noarch.rpm] to server

* Performing Repo Associations 
Package association Complete for Repo [upload2]: 
 Packages: 
gofer-0.20-1.fc14.noarch.rpm 
 
 Files: 
None

* Content Upload complete.
[root@preethi ~]# pulp-admin content upload -r upload2 /root/upload/gofer-0.20-1.fc14.noarch.rpm  --nosig -v 
* Starting Package Upload

* Performing Package Uploads to Pulp server
Package [gofer-0.20-1.fc14.noarch.rpm] already exists on the server with checksum [37f3605eabbb0ef9fb73f504b84422036e9af17f3d6247d594e610ca2a727df2]

* Performing Repo Associations 
Package association Complete for Repo [upload2]: 
 Packages: 
gofer-0.20-1.fc14.noarch.rpm 
 
 Files: 
None

* Content Upload complete.

Comment 4 Preethi Thomas 2011-08-16 12:11:26 UTC
Closing with Community Release 15

pulp-0.0.223-4.

Comment 5 Preethi Thomas 2011-08-16 12:22:55 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.