#7746 IPA help command fails in an environment without the `less` binary
Closed: fixed 5 years ago Opened 5 years ago by stlaz.


Culprit commit: caed210

The bug report doesn' follow the bug report template, e.g. doesn't state the version, expected behavior or use case. But I'll assume that the request here is to help in environments with and without less command. E.g. if there is less then show the output "paged" if not then print everything.

Also, the possible view on the bug could be that the respected client package doesn't depend on less.

a workaround is to set PAGER environment variable to a utility that can be used instead of less.

PAGER=more
export PAGER
ipa help commands

Easy fix: add less to package dependencies for python2-ipalib and python3-ipalib.

Metadata Update from @cheimes:
- Issue tagged with: easyfix

5 years ago

Easy fix: add less to package dependencies for python2-ipalib and python3-ipalib.

+1. If FreeIPA's code calls external less, it should make sure it is installed via rpm Requires.

Note that there is already support for $PAGER. What is missing is the test for the executable existence.

If the pager lookup is extracted from open_in_pager() then this would be pretty trivial:

pager = get_pager()
if os.path.exists(pager): open_in_pager(pager, data)
else: for something in something: print

Metadata Update from @okozlov:
- Issue assigned to okozlov

5 years ago

Metadata Update from @cheimes:
- Assignee reset
- Issue set to the milestone: FreeIPA 4.7.2

5 years ago

Metadata Update from @okozlov:
- Issue assigned to okozlov

5 years ago

master:

  • a0e0952 Check pager's executable before subprocess.Popen

ipa-4-7:

  • e0315a6 Check pager's executable before subprocess.Popen
  • c646f8a Fix python2 compatibility

Fixed. Added checking of a pager's executable before subprocess.Popen.

If PAGER environment variable is defined check it - do which (check the path, is it a file and check does it has +x). If it is ok - use a pager, otherwise - print function.

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

5 years ago

Metadata Update from @fcami:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1679958

5 years ago

Login to comment on this ticket.

Metadata