-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
[159] Fix issue with argument parsing logic for tf apply #274
Conversation
Pull Request Test Coverage Report for Build 9584808751Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 10565722330Details
💛 - Coveralls |
After consulting with @borland667 I've pushed a simplification to the originally proposed solution. The only thing we really need to worry is to find out if we are receiving a plan file as a last argument for the apply command. And in turn, prepend or not our terraform default parameters, which basically are the references to the correct |
leverage/modules/terraform.py
Outdated
# Handles '-var' and non '-' starting arguments | ||
new_args.append(arg) | ||
logger.debug(f"Appending argument (non '-' or '-var'): {arg}") | ||
def there_is_a_plan_file(args: Sequence[str]) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@angelofenoglio I'd update the name to has_plan_file_in_args
, I think that is more clear. We're good to merge anyway I reckon!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe contain_a_plan_file
would be better, the args
would be redundant having the parameter already called that way, has
or contains
wouldn't really fit since args
is plural.
What?
Implemented enhanced parsing logic in handle_apply_arguments_parsing to handle Terraform apply command arguments.Added support for various argument formats including -var, -var-file, -target, -lock, -parallelism, -compact-warnings, -input, -json, -auto-approve, -no-color, and combinations thereof.Simplified solution:
-var-file
arguments. These arguments collide with the presence of a plan file argument, so we need to implement logic to detect whether the user provided such argument or not, and then decide whether we need to add the variable file references to the rest of the arguments or not.Why?
References
closes #159
, if this PR closes a GitHub issue#159
Before release
Review the checklist here