Skip to content

Conversation

@npdgm
Copy link

@npdgm npdgm commented Jan 23, 2026

Fixes a Python typo in the error handler for oks-cli install-completion.
I'm running the CLI in a container and did not have the ps command, so the code was reached. Also confirmed by pylint -E.

Signed-off-by: Thibault VINCENT <thibault.vincent@enix.fr>
@npdgm npdgm requested a review from anton-kutin as a code owner January 23, 2026 10:52
@outscale-ykr
Copy link
Contributor

Hi @npdgm

I tried to reproduce the problem with oks-cli install-completion inside a container. I used the following Dockerfile:

FROM python:3.12-slim

# Install git and certificates
RUN apt-get update && \
    apt-get install -y --no-install-recommends git ca-certificates && \
    rm -rf /var/lib/apt/lists/*

# Install oks-cli
RUN pip install --no-cache-dir git+https://github.com/npdgm/oks-cli.git

WORKDIR /app
ENTRYPOINT ["oks-cli"]

Then I built and ran the container:

docker build -t oks-cli .
docker run -it --rm oks-cli install-completion

Instead of the expected SubprocessError, I got a FileNotFoundError: [Errno 2] No such file or directory: 'ps'. So, I suggest updating the exception handling to include FileNotFoundError as well:

except (subprocess.SubprocessError, FileNotFoundError):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants