Bug 981736 - pulp-admin exits code is 0 when sync fails
Summary: pulp-admin exits code is 0 when sync fails
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: user-experience
Version: 2.2 Beta
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 2.3.0
Assignee: Michael Hrivnak
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-05 16:04 UTC by Michael Hrivnak
Modified: 2013-12-09 14:29 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-09 14:29:53 UTC
Embargoed:


Attachments (Terms of Use)

Description Michael Hrivnak 2013-07-05 16:04:13 UTC
When an operation fails, the exit code from pulp-admin should be non-zero. For a failed sync, it is 0 as seen below.


[mhrivnak@dhcp-230-147 testing]$ pulp-admin rpm repo create --repo-id=foo --feed='http://kfhgksdghkerhglfd.com'
Successfully created repository [foo]

[mhrivnak@dhcp-230-147 testing]$ pulp-admin rpm repo sync run --repo-id=foo
+----------------------------------------------------------------------+
                     Synchronizing Repository [foo]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

Downloading metadata...
[\]
... failed

HTTPConnectionPool(host='khkdg.com', port=80): Max retries exceeded with url:
/repodata/repomd.xml (Caused by <class 'socket.gaierror'>: [Errno -2] Name or
service not known)

[mhrivnak@dhcp-230-147 testing]$ echo $?
0

Comment 1 Michael Hrivnak 2013-07-05 17:56:44 UTC
https://github.com/pulp/pulp/pull/526

Comment 2 Jeff Ortel 2013-09-12 22:35:28 UTC
build: 2.3.0-0.10.alpha

Comment 3 Preethi Thomas 2013-09-19 17:31:24 UTC
[root@pulp-v2-server ~]# rpm -qa pulp-server
pulp-server-2.3.0-0.14.alpha.el6.noarch
[root@pulp-v2-server ~]# 

[root@pulp-v2-server ~]#  pulp-admin rpm repo create --repo-id=foo --feed='http://kfhgksdghkerhglfd.com'
Successfully created repository [foo]

[root@pulp-v2-server ~]# pulp-admin rpm repo sync run --repo-id=foo
+----------------------------------------------------------------------+
                     Synchronizing Repository [foo]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

Downloading metadata...
[\]
... failed

[Errno -2] Name or service not known

[root@pulp-v2-server ~]# echo $?
1
[root@pulp-v2-server ~]#

Comment 4 Preethi Thomas 2013-12-09 14:29:53 UTC
Pulp 2.3 released.


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