Project

Profile

Help

Issue #4068

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

Added by Poil about 1 year ago. Updated 7 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
pulp-admin
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
2.18.0
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

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

Associated revisions

Revision 99ee3ad5 View on GitHub
Added by Benjamin DUPUIS about 1 year ago

Fix pulp-admin error when not running in tty

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

History

#1 Updated by Poil about 1 year 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

#2 Updated by Poil about 1 year 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'

#3 Updated by CodeHeeler about 1 year ago

  • Triaged changed from No to Yes

#4 Updated by dkliban@redhat.com about 1 year 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 message0
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

#6 Updated by daviddavis about 1 year ago

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

#7 Updated by Anonymous about 1 year ago

  • Status changed from POST to MODIFIED

#8 Updated by ttereshc 12 months ago

  • Platform Release set to 2.18.0

#9 Updated by ttereshc 12 months ago

  • Sprint/Milestone set to 2.18.0

#10 Updated by ttereshc 12 months ago

  • Status changed from MODIFIED to ON_QA

#11 Updated by ttereshc 11 months ago

  • Status changed from ON_QA to CLOSED - CURRENTRELEASE

#12 Updated by bmbouter 7 months ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF