-
Notifications
You must be signed in to change notification settings - Fork 176
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
WIP: Import changes from gitlab/dda/python-terraform #123
base: develop
Are you sure you want to change the base?
Conversation
@@ -52,6 +52,7 @@ def __init__( | |||
var_file: Optional[str] = None, | |||
terraform_bin_path: Optional[str] = None, | |||
is_env_vars_included: bool = True, | |||
terraform_version: Optional[float] = 0.13 |
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 we can find here sth better than float to encode terraform versions?
We will need comparison operators on the encoded versions.
Any idea?
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.
What is the purpose of this value ? Can't we detect the version that is currently installed and use it ?
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.
I've added a second comment at a location where we use the terraform version. There are many more locations like the commented one.
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.
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.
sounds good :-)
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.
Implemented your suggestion on our repo:
https://gitlab.com/domaindrivenarchitecture/python-terraform/-/merge_requests/2
What do you think ?
If you agree I will sqash & merge. You can bring back my change by cherry pick?
I think, we should reflect all changes since june 21 in the PR ... |
I've re-applied the changes since June 2021. Let me know if you see any other thing missing |
default = kwargs.copy() | ||
default["force"] = force | ||
# force is no longer a flag in version >= 1.0 | ||
if self.terraform_version < 1.0: |
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.
Here we use the terraform_version in order to distinguishe between 0.x & 1.x
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.
I see 👍
Reintegrated the upstream changes & got green tests |
|
||
def list_workspace(self) -> List[str]: | ||
"""List of workspaces | ||
|
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.
global_opts = self._generate_default_general_options(False)
is needed here.
|
||
def list_workspace(self) -> List[str]: | ||
"""List of workspaces | ||
|
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.
Line 454 should be (self.cmd(global_opts, "workspace", "list")[1] or '').split()
This PR contains the changes to support Terraform version 1.x, that have been applied on the gitlab repository dda/python-terraform