Skip to content

Fixes #39079 - Fix containerfile-install-command when no packages found#1021

Merged
chris1984 merged 1 commit into
Katello:mainfrom
pavanshekar:issue-39079
Feb 17, 2026
Merged

Fixes #39079 - Fix containerfile-install-command when no packages found#1021
chris1984 merged 1 commit into
Katello:mainfrom
pavanshekar:issue-39079

Conversation

@pavanshekar
Copy link
Copy Markdown
Contributor

The API was changed to return packageCount: 0 with HTTP 200 when no transient packages are found, instead of returning a message with HTTP 404. This caused the command to display nothing and exit with code 0.

This PR adds an execute method override that checks the packageCount field and displays "No transient packages found" with a non-zero exit code when no packages are present.

Copy link
Copy Markdown

@vsedmik vsedmik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally-wise looks good to me - the test passed detecting the expected result against a packit VM.

2026-02-16 11:37:57 - broker.hosts - DEBUG - sat.redhat.com executing command: LANG=en_US.UTF-8  hammer -v -u admin -p <pass>  host package containerfile-install-command --host-id="2" 
2026-02-16 11:37:57 - broker.hosts - DEBUG - Creating SSH session to sat.redhat.com
2026-02-16 11:37:57 - broker.session - DEBUG - Attempting to load SSH backend: hussh
2026-02-16 11:38:02 - broker.hosts - DEBUG - sat.redhat.com command result:
    stdout:
    
    stderr:
    No transient packages found
    
    status: 128

Copy link
Copy Markdown
Member

@chris1984 chris1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, code looks good to ME and tested it

Copy link
Copy Markdown
Member

@ianballou ianballou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well, thanks!

[vagrant@centos9-hammer-devel hammer-cli-katello]$ hammer host package containerfile-install-command --host-id 13

No transient packages found

[vagrant@centos9-hammer-devel hammer-cli-katello]$ hammer host package containerfile-install-command --host-id 2

RUN dnf install -y acl-2.3.2-4.el10.x86_64

@chris1984 chris1984 merged commit 661a758 into Katello:main Feb 17, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants