From dd439df921d04b685dcbb3284ca4bf3cbb398a65 Mon Sep 17 00:00:00 2001 From: Loren Gordon Date: Thu, 6 Jan 2022 07:41:12 -0800 Subject: [PATCH] Adds support for the upgrade argument of the init command Closes #39 --- test/test_args.py | 2 ++ tftest.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/test/test_args.py b/test/test_args.py index 45199c8..53712a7 100644 --- a/test/test_args.py +++ b/test/test_args.py @@ -41,6 +41,8 @@ ({'refresh': True}, []), ({'refresh': None}, []), ({'refresh': False}, ['-refresh=false']), + ({'upgrade': True}, ['-upgrade']), + ({'upgrade': False}, []), ({'tf_var_file': None}, []), ({'tf_var_file': 'foo.tfvar'}, ['-var-file=foo.tfvar']), ) diff --git a/tftest.py b/tftest.py index 9c9a619..8d82fd8 100644 --- a/tftest.py +++ b/tftest.py @@ -125,6 +125,8 @@ def parse_args(init_vars=None, tf_vars=None, targets=None, **kw): cmd_args += ['-plugin-dir', kw['plugin_dir']] if kw.get('refresh') is False: cmd_args.append('-refresh=false') + if kw.get('upgrade'): + cmd_args.append('-upgrade') if isinstance(init_vars, dict): cmd_args += ['-backend-config={}={}'.format(k, v) for k, v in init_vars.items()]