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
Refactor #30
Merged
Merged
Refactor #30
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This makes testing with custom images a lot easier and smoother as they won't need to be uploaded to docker hub.
Almost all cases where the environment is checked is done in order for run_container() to function properly, so it makes more sense to do the check there.
This is makeslocal testing easier
Instead of having one --image option on each command, it's now in the toplevel and sets the global variable DOCKER_IMAGE which is then used directly by `run_in_container` and `download_image`.
Before one had to quote the args to `rega terraform` and `rega openstack`, now its possible to just add them naturally after the command as if they were running directly on the command line. Before: $ rega terraform 'apply --long-option' After: $ rega terraform apply --long-option
viklund
force-pushed
the
feature/small-refactor
branch
from
August 22, 2019 10:47
323321e
to
564f4d0
Compare
Good improvements! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe the pull request
Pull request long description
A lot of very small changes to improve stuff and make the program easier to use and navigate, I recommend checking this one commit at a time since every commit is basically one self-contained thing.
Changes made
These are the commits, with short explanations where needed. Even more information can be found in the commit messages.
Almost all commands run this function, so putting it in a common place made more sense to me.
This simplifies development and testing a lot e.g.
python rke-openstack/rega/cmd.py provision
I ran pylint and corrected some of the warnings
Instead of having an
--image
argument for each command, this is now an option on the toplevel command.It was cumbersome to run the executables inside the docker image. One had to quote the commandline in cases where multiple words were used (see the commit).
This is similar to the check_environment change above
I see no point in doing that here
Just one instance where error was printed on
stdout
.