This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 981736 - pulp-admin exits code is 0 when sync fails
pulp-admin exits code is 0 when sync fails
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: user-experience (Show other bugs)
2.2 Beta
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 2.3.0
Assigned To: Michael Hrivnak
Preethi Thomas
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-05 12:04 EDT by Michael Hrivnak
Modified: 2013-12-09 09:29 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-09 09:29:53 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 Michael Hrivnak 2013-07-05 12:04:13 EDT
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 13:56:44 EDT
https://github.com/pulp/pulp/pull/526
Comment 2 Jeff Ortel 2013-09-12 18:35:28 EDT
build: 2.3.0-0.10.alpha
Comment 3 Preethi Thomas 2013-09-19 13:31:24 EDT
[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 09:29:53 EST
Pulp 2.3 released.

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