There is a bug with the Terraform.apply method, when passing in var_file as an argument, it would also create an empty tmp var-file, which results in an error: An argument or block definition is required here.
terraform workspace commands are structured differently than the rest of the command, as new, select, etc are considered subcommands. It'd be nice if we could be able to pass flags and options into those commands without them being jumbled up as such terraform workspace --no-color select workspace_name, and terraform would not be able to interpret this command.
What has changed?
Added explicit condition to check if the option is var, continue if empty.
added a constant COMMAND_WITH_SUBCOMMANDS, to store commands that may have subcommands. Should terraform add new commands with subcommands, we will be able to append to this list easily.
Allowing workspace related method to pass flags and options.
Added tests to cover the changes made.
Next Steps
Workspace commands can be refined further, for now, what we have is okay.
If you could release a new version on PyPi after merging this PR, that would be amazing! 😸
Why am I sending this PR?
Terraform.apply
method, when passing invar_file
as an argument, it would also create an empty tmp var-file, which results in an error:An argument or block definition is required here
.terraform workspace
commands are structured differently than the rest of the command, asnew
,select
, etc are considered subcommands. It'd be nice if we could be able to pass flags and options into those commands without them being jumbled up as suchterraform workspace --no-color select workspace_name
, and terraform would not be able to interpret this command.What has changed?
var
, continue if empty.COMMAND_WITH_SUBCOMMANDS
, to store commands that may have subcommands. Should terraform add new commands with subcommands, we will be able to append to this list easily.Next Steps