Project

Profile

Help

Issue #427

closed

Return code of the operation called by pulp-admin should be propagated to pulp-admin

Added by ipanova@redhat.com about 9 years ago. Updated about 5 years ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

The return code of pulp-admin is always 0 which is not correct. This is a broad issue so the example in this bug is one single example. This bug is to fix all return code usage.

Commands that were called by pulp-admin should propagate in a proper way their return codes to pulp-admin. In other words pulp-admin should have same return code as the command it called.

For the command:

pulp-admin -u admin -p admin rpm consumer package install run --name some_rpm --consumer-id c1

Produces the output:

Install task created with id [ 44307c9e-c721-4b56-8e87-1954c104e3de ]

This command may be exited via ctrl+c without affecting the request.

Refresh Repository Metadata

Install Failed

failure: repodata/repomd.xml from m2: [Errno 256] No more mirrors to
try.
https://example.com/pulp/repos/m2/repo
data/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found

The return code in this case is still 0 which is incorrect.

[root@ec2-54-220-72-88 ~]# echo $?
0

If the script would call pulp-admin it would have to grep for any failure(that would complicate significantly the real life scenarios) instead of just checking the return code.


Related issues

Has duplicate Pulp - Issue #1637: Pulp Admin returns 0 even when there are errorsCLOSED - DUPLICATEActions
Actions #1

Updated by mhrivnak about 9 years ago

The pulp-admin exit code should be non-zero in this case, but should not necessarily mirror the exit code encountered by a handler on a consumer. The handler may not necessarily run a command that returns an exit code at all.

+ This comment was cloned from Bugzilla #1096875 comment 1 +

Actions #2

Updated by bmbouter about 8 years ago

  • Has duplicate Issue #1637: Pulp Admin returns 0 even when there are errors added
Actions #3

Updated by bmbouter about 8 years ago

  • Description updated (diff)
  • Category set to 15
  • Severity set to 2. Medium
Actions #4

Updated by bmbouter about 5 years ago

  • Status changed from NEW to CLOSED - WONTFIX
Actions #5

Updated by bmbouter about 5 years ago

Pulp 2 is approaching maintenance mode, and this Pulp 2 ticket is not being actively worked on. As such, it is being closed as WONTFIX. Pulp 2 is still accepting contributions though, so if you want to contribute a fix for this ticket, please reopen or comment on it. If you don't have permissions to reopen this ticket, or you want to discuss an issue, please reach out via the developer mailing list.

Actions #6

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF