[aap_containerized] Add container command#4030
Conversation
|
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
Add commands to list_instance and check_licenses. Signed-off-by: Lucas Benedito <lbenedit@redhat.com>
22d00ed to
ecd65c4
Compare
| podman_commands = [ | ||
| (f"su - {username} -c 'podman exec -it {container} bash -c" | ||
| " \"awx-manage check_license --data\"'", | ||
| "awx-manage_check_license_--data"), | ||
| (f"su - {username} -c 'podman exec -it {container} bash -c" | ||
| " \"awx-manage list_instances\"'", | ||
| "awx-manage_list_instances"), | ||
| ] | ||
| for command, filename in podman_commands: | ||
| self.add_cmd_output(command, suggest_filename=filename) |
There was a problem hiding this comment.
Does this not work using the runas and container parameters for add_cmd_output()?
E.G.
podman_commands = [
'awx-manage check-license --data'
...etc...
]
for command in podman_commands:
self.add_cmd_output(command, suggest_filename=command, runas=username, container=container)Or, now remembering we do have some limitations there, dropping the su bit and just using runas to execute the podman command directly?
There was a problem hiding this comment.
From my tests. With the runas and container, the sos report fails to find the container.
$ sos report -o aap_containerized -k aap_containerized.username=devops -vvv
...
[plugin:aap_containerized] Skipping command 'awx-manage check_license --data' as the requested container 'automation-controller-task' does not exist.
[plugin:aap_containerized] Skipping command 'awx-manage list_instances' as the requested container 'automation-controller-task' does not exist.
The same execution with the current commit collects the data correctly from the container.
There was a problem hiding this comment.
@TurboTurtle based on the output above, should I keep it with the su - commands?
There was a problem hiding this comment.
Hmm, guess we should look into that. I have an idea as to why that's happening but it'd take a bit to address it and I don't want that to hold this up any further.
ack, with a note on me to look into the runas and container combination.
Add commands to list_instance and check_licenses.
Closes: AAP-22872, RHEL-93893
Signed-off-by: Lucas Benedito lbenedit@redhat.com
Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines