INNER CODE UNIT · Python
parse_args
GoogleCloudPlatform/terraform-python-testing-helper · tftest.py:57
def parse_args(init_vars=None, tf_vars=None, targets=None, **kw):
"""Convert method arguments for use in Terraform commands.
Args:
init_vars: dict of key/values converted to -backend-config='k=v' form, or
string argument converted to -backend-config=arg
tf_vars: dict of key/values converted to -var k=v form.
**kw: converted to the appropriate Terraform flag.
Returns:
A list of command arguments for use with subprocess.
"""
cmd_args = []
bool_flags = {
'auto_approve': '-auto-approve',
'force_copy': '-force-copy',
'json_format': '-json',