Project

Profile

Help

Issue #4068

closed

pulp-admin in cron : "IOError: [Errno 25] Inappropriate ioctl for device"

Added by Poil over 5 years ago. Updated about 5 years ago.

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

Description

Hi,

When I try to run `pulp-admin rpm repo list --summary` in cron I have this traceback

2018-10-08 09:34:02,279 - INFO - Response body :
 [
  {
.............. The json that seems to be OK
  }
]

2018-10-08 09:34:02,280 - ERROR - Client-side exception occurred
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/client/extensions/core.py", line 474, in run
    exit_code = Cli.run(self, args)
  File "/usr/lib/python2.7/site-packages/okaara/cli.py", line 974, in run
    exit_code = command_or_section.execute(self.prompt, remaining_args)
  File "/usr/lib/python2.7/site-packages/pulp/client/extensions/extensions.py", line 210, in execute
    return self.method(*arg_list, **clean_kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/client/commands/repo/cudl.py", line 331, in run
    self.display_repository_summaries(**kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/client/commands/repo/cudl.py", line 395, in display_repository_summaries
    _default_summary_view(repo_list, self.prompt)
  File "/usr/lib/python2.7/site-packages/pulp/client/commands/repo/cudl.py", line 520, in _default_summary_view
    terminal_width = prompt.terminal_size()[0]
  File "/usr/lib/python2.7/site-packages/okaara/prompt.py", line 379, in terminal_size
    ioctl = fcntl.ioctl(0, termios.TIOCGWINSZ, struct.pack('HHHH', 0, 0, 0, 0))
IOError: [Errno 25] Inappropriate ioctl for device
Actions #1

Updated by Poil over 5 years ago

It seems that ookara does not have a fallback if no terminal, for example, pexpect have : https://pexpect.readthedocs.io/en/3.x/_modules/pexpect.html

Actions #2

Updated by Poil over 5 years ago

I've patch `/usr/lib/python2.7/site-packages/pulp/client/commands/repo/cudl.py` with a try except, that do the job

    # The model being followed for this view is `yum repolist`. That command
    # will always show the full ID without truncating. Any remaining space is
    # left for the name (sort of; they have a status column that isn't relevant
    # here).

    try:
        terminal_width = prompt.terminal_size()[0]
    except:
        terminal_width = 80
    line_template = '%s  %s'
Actions #3

Updated by CodeHeeler over 5 years ago

  • Triaged changed from No to Yes
Actions #4

Updated by dkliban@redhat.com over 5 years ago

Thank you for reporting this issue. Could you please submit a PR?

1. Fork pulp repository
2. Write your patch
3. Write appropriate commit message[0]
4. Push your changes to github
5. open pull request against 2-master branch

[0] https://docs.pulpproject.org/en/2.17/nightly/dev-guide/contributing/branching.html#commit-messages

Actions #6

Updated by daviddavis over 5 years ago

  • Status changed from NEW to POST
  • Assignee set to Poil

Added by Benjamin DUPUIS over 5 years ago

Revision 99ee3ad5 | View on GitHub

Fix pulp-admin error when not running in tty

fixes #4068 https://pulp.plan.io/issues/4068

Actions #7

Updated by Anonymous over 5 years ago

  • Status changed from POST to MODIFIED
Actions #8

Updated by ttereshc over 5 years ago

  • Platform Release set to 2.18.0
Actions #9

Updated by ttereshc over 5 years ago

  • Sprint/Milestone set to 2.18.0
Actions #10

Updated by ttereshc over 5 years ago

  • Status changed from MODIFIED to 5
Actions #11

Updated by ttereshc over 5 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE
Actions #12

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF