Bug 679441

Summary: pulp-admin package upload doesn't print errors and exits with 0
Product: [Retired] Pulp Reporter: Daniel Mach <dmach>
Component: z_otherAssignee: Pradeep Kilambi <pkilambi>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: high Docs Contact:
Priority: high    
Version: unspecified   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-16 12:06:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 563609, 647488    

Description Daniel Mach 2011-02-22 15:32:15 UTC
$ pulp-admin --username=admin --password=admin package upload <rpm>
* Starting Package Upload operation. See /var/log/pulp/client.log for more verbose output

* Performing Package Uploads to Pulp server

* Content Upload complete.

$ echo $?
0


/var/log/pulp/client.log contains:
2011-02-22 16:28:32,613 [ERROR][MainThread] @ package.py:284 - Package [<rpm>] is not signed. Please use --nosig. Skipping 
2011-02-22 16:28:32,613 [ERROR][MainThread] @ base.py:239 - error: 0


The --nosig message should be printed to stderr as well and exit code should be non-zero.
BTW, when fixing this, please make sure this message is printed before *sha256sum* is computed and package upload is skipped; it would save some CPU power.

Comment 1 Pradeep Kilambi 2011-02-22 15:53:46 UTC
The error messages are printed if you use -v or verbose option. This is on purpose. Regarding the error codes, I'll look into it.

Comment 2 Pradeep Kilambi 2011-02-22 16:12:19 UTC
$ sudo pulp-admin package upload /home/pkilambi/Downloads/skytux-repo-1.0-4.noarch.rpm -v
* Starting Package Upload

* Performing Package Uploads to Pulp server
Package [/home/pkilambi/Downloads/skytux-repo-1.0-4.noarch.rpm] is not signed. Please use --nosig. Skipping 

* Content Upload complete.
[pkilambi@localhost unit]$ echo $?
65

Comment 3 Daniel Mach 2011-02-22 16:25:56 UTC
Thanks for a quick fix!

I'm still thinking about another improvement:
Couldn't you replace "Content Upload complete." with "Content Upload succeeded." and "Content Upload failed." according to the exit code?

Comment 4 Pradeep Kilambi 2011-02-22 16:43:51 UTC
So, the reason I chose "complete" is because we're doing a batch uploads here and some could have succeed and some failed and skipped. So "complete" felt more appropriate. As the process itself is complete with succeed and failed as shown as verbose output.

Comment 5 Jeff Ortel 2011-02-23 17:59:55 UTC
Build: 0.141

Comment 6 Preethi Thomas 2011-02-28 20:45:48 UTC
verified
[root@preethi ~]# rpm -q pulp
pulp-0.0.143-1.fc14.noarch

[root@preethi ~]# pulp-admin  content upload --dir=/root/upload/ -r upload -v
* Starting Package Upload

* Performing Package Uploads to Pulp server
Package [/root/upload/grinder-0.0.81-1.fc14.noarch.rpm] is not signed. Please use --nosig. Skipping 
Package [/root/upload/pulp-cds-0.0.143-1.fc14.noarch.rpm] is not signed. Please use --nosig. Skipping 
No applicable content to associate.



[root@preethi ~]# pulp-admin  content upload --dir=/root/upload/ -r upload -v --nosig
* Starting Package Upload

* Performing Package Uploads to Pulp server
Successfully uploaded [grinder-0.0.81-1.fc14.noarch.rpm] to server
Successfully uploaded [pulp-cds-0.0.143-1.fc14.noarch.rpm] to server

* Performing Repo Associations 
Package association Complete for Repo [upload]: 
 Packages: 
pulp-cds-0.0.143-1.fc14.noarch.rpm
grinder-0.0.81-1.fc14.noarch.rpm 
 
 Files: 
None

* Content Upload complete.

Comment 7 Preethi Thomas 2011-08-16 12:06:40 UTC
Closing with Community Release 15

pulp-0.0.223-4.

Comment 8 Preethi Thomas 2011-08-16 12:20:41 UTC
Closing with Community Release 15

pulp-0.0.223-4.