#8588 The 'ipactl status' command exit code does not fail on a partial error
Closed: fixed by frenaud. Opened by tvaughan.

Request for enhancement

As an IPA user, I want the ipactl status exit codes to fail on partial errors so that I do not have to process text messages that may change in the future.

Issue

ipactl status will return an exit code of 0 even when it cannot complete its tasking properly.

Steps to Reproduce

  1. systemctl stop dirsrv@domain.service
  2. Run ipactl status
    • Outputs text that the command cannot complete fully
  3. test $? -eq 0 && echo 'BAD'

Actual behavior

BAD is printed.

Expected behavior

BAD should not be printed because a failure to get the system state is an error.

Version/Release/Distribution

$ ipa-server-4.6.8-5.el7.centos.x86_64


Metadata Update from @rcritten:
- Issue assigned to rcritten

Part of https://github.com/freeipa/freeipa/pull/5485

master:

  • 62521edcd17f2d24393377513afc9acb3e397410 Change CA profile migration message from info to debug
  • daf2ca3ead0f529dd3bcfd2aba97a410638dba7d Use the new API introduced in PKI 10.8
  • 928ab51be669d7af7a28205acb9eb7e9b46e189e ipactl: support script status 3, program is not running
  • 1870c933542d41766dd9e2076deb7db758726864 Ensure IPA is running (ideally) before uninstalling the KRA
  • ed21787190382707f9d80559967f71637c8bf408 Add exit status to the ipactl man page
  • 8082a2d9eb96c4d5471b72e6a008cd273ec743cd ipatests: Handle non-zero return code in test_ipactl_scenario_check

ipa-4-9:

  • b99bc2d8b1e5226f61a7c980cfb7576dac222466 Change CA profile migration message from info to debug
  • 4d26ce5061c5b7f9383286a108fc48b19b5bc65a Use the new API introduced in PKI 10.8
  • ddb5414d56f57fdd18ad66fbc6a53410725dd9cd ipactl: support script status 3, program is not running
  • 87ede26cc2bcbe543cb970a5e55cf1901791a100 Ensure IPA is running (ideally) before uninstalling the KRA
  • 302f9377e5c760bcf38be2b0503915ccadef8b67 Add exit status to the ipactl man page
  • 00226adaa68935fbc1d85508eadafa420027edb5 ipatests: Handle non-zero return code in test_ipactl_scenario_check

Metadata Update from @frenaud:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

master:

  • 610d542c0eba50890aac9dad79d283828644597c ipatests: ipactl status now exits with 3 when a service is stopped

ipa-4-9:

  • 8d30629801a88a8f03c94f2274ed93a1ff0a38be ipatests: ipactl status now exits with 3 when a service is stopped
Metadata