ClusterLabs / ClusterLabs/pcs

Pcs (and consequently and painfully, respective interactive execution to figure out the respective bash completion atoms) is not robust when it comes to keyboard interrupts

Open
#152 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
265
Forks
122
Avg merge
13h 23m
Merged PRs (30d)
14

Description

What I did:

```
$ pcs --
```

What I got (for instance):

```
File "/usr/sbin/pcs", line 6, in
from pkg_resources import load_entry_point
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3038, in
@_call_aside
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3022, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3051, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 648, in _build_master
ws = cls()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 641, in __init__
self.add_entry(entry)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 697, in add_entry
for dist in find_distributions(entry, True):
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2033, in find_on_path
path_item, entry, metadata, precedence=DEVELOP_DIST
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2452, in from_location
py_version=py_version, platform=platform, **kw
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2792, in _reload_version
md_version = _version_from_file(self._get_metadata(self.PKG_INFO))
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2417, in _version_from_file
line = next(iter(version_lines), '')
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2584, in _get_metadata
if self.has_metadata(name):
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2624, in __getattr__
def __getattr__(self, attr):
KeyboardInterrupt
```

I.e. `/usr/sbin/pcs` needs to catch that exception from the very beginning
(ultimate solution for https://bugzilla.redhat.com/show_bug.cgi?id=1354498,
indeed, it should respond to it per the current context of use, but exit right
away when being run to complete something).

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported `pcs --` behavior and inspect the `/usr/sbin/pcs` entry point, including startup before the application loads. Determine how the KeyboardInterrupt should be handled for completion and interactive use; done means interruption no longer emits the shown traceback while the command exits appropriately.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.