Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update control.py #226

Merged
merged 1 commit into from
Jan 31, 2023
Merged

Update control.py #226

merged 1 commit into from
Jan 31, 2023

Conversation

TheeNawMan
Copy link
Contributor

Added ubuntu 22.04 docker-compose path of /usr/bin/docker-compose as it is not in local.

Ubuntu 22.04 puts docker-compose in /usr/bin/docker-compose control.py does not currently check for that location and so the script fails.#

Added ubuntu 22.04 docker-compose path of /usr/bin/docker-compose as it is not in local.
@mmguero
Copy link
Collaborator

mmguero commented Jan 10, 2023

Interesting, I would have thought the Which('docker-compose') a few lines above it would have found it, as I assumed /usr/bin would be always be in PATH. Thanks.

mmguero added a commit to mmguero-dev/Malcolm that referenced this pull request Jan 10, 2023
@TheeNawMan
Copy link
Contributor Author

A more effective way of checking for this would to be utilize the which command in linux to see if it exists and if it fails then raise the exception.

@mmguero
Copy link
Collaborator

mmguero commented Jan 10, 2023

Agreed, I thought that's what I was doing (calling here, my cross platform implementation here).

@TheeNawMan
Copy link
Contributor Author

I was reading way to fast and didn't realize the which command above. I did this in a pinch trying to start something up I will do some more debugging and see if I can find the issue with the original code

@mmguero
Copy link
Collaborator

mmguero commented Jan 10, 2023

I'll look tomorrow, too. But either way I have no issue with your tweak.

@TheeNawMan
Copy link
Contributor Author

So in my testing the result is just returning "True". It does not spit out the actual path to use docker-compose. I don't understand why the python script can't just pull docker-compose through path since it returns True. Maybe you could use subprocess module to run the native which command and grab the path variable and if null spit to your error section.

@mmguero
Copy link
Collaborator

mmguero commented Jan 11, 2023

Interesting, so it's finding that docker-compose is in the PATH, but the actual exec isn't running it from the path. Yeah, that's a good idea, I'll pull something like that together.

@mmguero mmguero merged commit d1434c1 into cisagov:main Jan 31, 2023
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.

2 participants