From a001164534c434e77246233363b1012d02d3a3e5 Mon Sep 17 00:00:00 2001 From: Angelo Fenoglio Date: Mon, 26 Aug 2024 16:07:48 -0300 Subject: [PATCH] Update method name --- leverage/modules/terraform.py | 4 ++-- tests/test_modules/test_terraform.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/leverage/modules/terraform.py b/leverage/modules/terraform.py index b4aeafc..357ae08 100644 --- a/leverage/modules/terraform.py +++ b/leverage/modules/terraform.py @@ -352,7 +352,7 @@ def _plan(tf, args): raise Exit(exit_code) -def there_is_a_plan_file(args: Sequence[str]) -> bool: +def has_a_plan_file(args: Sequence[str]) -> bool: """Determine whether the list of arguments has a plan file at the end. Terraform apply arguments have the form "-target ADDRESS" or "-target=ADDRESS" @@ -402,7 +402,7 @@ def there_is_a_plan_file(args: Sequence[str]) -> bool: @pass_container def _apply(tf, args: Sequence[str]) -> None: """Build or change the infrastructure in this layer.""" - default_args = [] if there_is_a_plan_file(args) else tf.tf_default_args + default_args = [] if has_a_plan_file(args) else tf.tf_default_args logger.debug(f"Default args passed to apply command: {default_args}") exit_code = tf.start_in_layer("apply", *default_args, *args) diff --git a/tests/test_modules/test_terraform.py b/tests/test_modules/test_terraform.py index 7d1fae7..2ccc5fb 100644 --- a/tests/test_modules/test_terraform.py +++ b/tests/test_modules/test_terraform.py @@ -7,7 +7,7 @@ from leverage._utils import AwsCredsContainer from leverage.container import TerraformContainer from leverage.modules.terraform import _init -from leverage.modules.terraform import there_is_a_plan_file +from leverage.modules.terraform import has_a_plan_file from tests.test_containers import container_fixture_factory @@ -84,4 +84,4 @@ def test_init_with_args(terraform_container): ], ) def test_apply_arguments_have_plan_file(args, expected_output): - assert there_is_a_plan_file(tuple(args)) == expected_output + assert has_a_plan_file(tuple(args)) == expected_output