#7780 Make ipa-client-automount --uninstall more robust
Closed: fixed Opened by fcami.

ipa-client-automount calls systemctl stop/disable without exception checking during uninstallation.

When units are renamed this leads to a crash:

# ipa-client-automount --uninstall -U
Restoring configuration
Traceback (most recent call last):
  File "/usr/sbin/ipa-client-automount", line 537, in <module>
    sys.exit(main())
  File "/usr/sbin/ipa-client-automount", line 426, in main
    return uninstall(fstore, statestore)
  File "/usr/sbin/ipa-client-automount", line 324, in uninstall
    rpcidmapd.stop()
  File "/usr/lib/python3.6/site-packages/ipaplatform/base/services.py", line 290, in stop
    ipautil.run(args, skip_output=not capture_output)
  File "/usr/lib/python3.6/site-packages/ipapython/ipautil.py", line 574, in run
    p.returncode, arg_string, output_log, error_log
ipapython.ipautil.CalledProcessError: CalledProcessError(Command ['/bin/systemctl', 'stop', 'nfs-idmap.service'] returned non-zero exit status 5: 'Failed to stop nfs-idmap.service: Unit nfs-idmap.service not loaded.\n')

Metadata Update from @fcami:
- Issue assigned to fcami

Metadata Update from @fcami:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/2627
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1645501

Metadata Update from @fcami:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1645501, https://bugzilla.redhat.com/show_bug.cgi?id=1645501 (was: https://bugzilla.redhat.com/show_bug.cgi?id=1645501)

Issue linked to Bugzilla: Bug 1645501

Metadata Update from @fcami:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/2657 (was: https://github.com/freeipa/freeipa/pull/2627)

Metadata Update from @fcami:
- Issue set to the milestone: FreeIPA 4.7.2

Metadata Update from @fcami:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1645501 (was: https://bugzilla.redhat.com/show_bug.cgi?id=1645501, https://bugzilla.redhat.com/show_bug.cgi?id=1645501)

master:

  • 97f87513ef345908c74f27c71e7765c16d3abe8c Fix NFS unit names
  • 6a56aa6d4987bc4856997351a413c014e14abdd6 ipa-client-automount: use nfs-utils unit
  • 7c0b0f34716cabbdc48edf959935b37a21883238 ipatests: add a test for ipa-client-automount

Metadata Update from @fcami:
- Issue set to the milestone: FreeIPA 4.7.3 (was: FreeIPA 4.7.2)

ipa-4-7:

  • 65f6c8dc2585144b17ff89e63e4ba300971996dd Fix NFS unit names
  • 0687e4869995842a90d5d656749de42daceb2ad4 ipa-client-automount: use nfs-utils unit
  • dfd741d3cd9c9d695e7ad6f88dcd4432fb73c126 ipatests: add a test for ipa-client-automount

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

Metadata