diff --git a/koku/masu/database/aws_report_db_accessor.py b/koku/masu/database/aws_report_db_accessor.py index 7c99ae634c..4c4a9a8905 100644 --- a/koku/masu/database/aws_report_db_accessor.py +++ b/koku/masu/database/aws_report_db_accessor.py @@ -21,7 +21,6 @@ from masu.database import AWS_CUR_TABLE_MAP from masu.database import OCP_REPORT_TABLE_MAP from masu.database.report_db_accessor_base import ReportDBAccessorBase -from masu.processor import is_feature_cost_3592_tag_mapping_enabled from masu.processor import is_feature_unattributed_storage_enabled_aws from reporting.models import OCP_ON_ALL_PERSPECTIVES from reporting.models import OCP_ON_AWS_PERSPECTIVES @@ -299,8 +298,6 @@ def populate_ocp_on_aws_tag_information(self, bill_ids, start_date, end_date, re sql = sql.decode("utf-8") self._prepare_and_execute_raw_sql_query(self._table_map["ocp_on_aws_tags_summary"], sql, sql_params) # Tag Mapping - if not is_feature_cost_3592_tag_mapping_enabled(self.schema): - return with schema_context(self.schema): # Early return check to see if they have any tag mappings set. if not TagMapping.objects.filter( @@ -359,8 +356,6 @@ def update_line_item_daily_summary_with_tag_mapping(self, start_date, end_date, Returns: (None) """ - if not is_feature_cost_3592_tag_mapping_enabled(self.schema): - return with schema_context(self.schema): # Early return check to see if they have any tag mappings set. if not TagMapping.objects.filter(child__provider_type=Provider.PROVIDER_AWS).exists(): diff --git a/koku/masu/database/azure_report_db_accessor.py b/koku/masu/database/azure_report_db_accessor.py index 7aef190775..ad14e936a7 100644 --- a/koku/masu/database/azure_report_db_accessor.py +++ b/koku/masu/database/azure_report_db_accessor.py @@ -21,7 +21,6 @@ from masu.database import AZURE_REPORT_TABLE_MAP from masu.database import OCP_REPORT_TABLE_MAP from masu.database.report_db_accessor_base import ReportDBAccessorBase -from masu.processor import is_feature_cost_3592_tag_mapping_enabled from masu.processor import is_feature_unattributed_storage_enabled_azure from reporting.models import OCP_ON_ALL_PERSPECTIVES from reporting.models import OCP_ON_AZURE_PERSPECTIVES @@ -167,8 +166,6 @@ def populate_ocp_on_azure_tag_information(self, bill_ids, start_date, end_date, sql = sql.decode("utf-8") self._prepare_and_execute_raw_sql_query(self._table_map["ocp_on_azure_tags_summary"], sql, sql_params) # Tag Mapping - if not is_feature_cost_3592_tag_mapping_enabled(self.schema): - return with schema_context(self.schema): # Early return check to see if they have any tag mappings set. if not TagMapping.objects.filter( @@ -321,8 +318,6 @@ def update_line_item_daily_summary_with_tag_mapping(self, start_date, end_date, Returns: (None) """ - if not is_feature_cost_3592_tag_mapping_enabled(self.schema): - return with schema_context(self.schema): # Early return check to see if they have any tag mappings set. if not TagMapping.objects.filter(child__provider_type=Provider.PROVIDER_AZURE).exists(): diff --git a/koku/masu/database/gcp_report_db_accessor.py b/koku/masu/database/gcp_report_db_accessor.py index a428ebfbde..26efe4f64b 100644 --- a/koku/masu/database/gcp_report_db_accessor.py +++ b/koku/masu/database/gcp_report_db_accessor.py @@ -24,7 +24,6 @@ from masu.database import GCP_REPORT_TABLE_MAP from masu.database import OCP_REPORT_TABLE_MAP from masu.database.report_db_accessor_base import ReportDBAccessorBase -from masu.processor import is_feature_cost_3592_tag_mapping_enabled from masu.util.gcp.common import check_resource_level from masu.util.ocp.common import get_cluster_alias_from_cluster_id from reporting.models import OCP_ON_GCP_TEMP_MANAGED_TABLES @@ -495,8 +494,6 @@ def populate_ocp_on_gcp_tag_information(self, gcp_bill_ids, start_date, end_date sql = sql.decode("utf-8") self._prepare_and_execute_raw_sql_query(self._table_map["ocp_on_gcp_tags_summary"], sql, sql_params) # Tag Mapping - if not is_feature_cost_3592_tag_mapping_enabled(self.schema): - return with schema_context(self.schema): # Early return check to see if they have any tag mappings set. if not TagMapping.objects.filter( @@ -519,8 +516,6 @@ def update_line_item_daily_summary_with_tag_mapping(self, start_date, end_date, Returns: (None) """ - if not is_feature_cost_3592_tag_mapping_enabled(self.schema): - return with schema_context(self.schema): # Early return check to see if they have any tag mappings set. if not TagMapping.objects.filter(child__provider_type=Provider.PROVIDER_GCP).exists(): diff --git a/koku/masu/database/oci_report_db_accessor.py b/koku/masu/database/oci_report_db_accessor.py index b9b836a5ea..03546dcb29 100644 --- a/koku/masu/database/oci_report_db_accessor.py +++ b/koku/masu/database/oci_report_db_accessor.py @@ -15,7 +15,6 @@ from koku.database import SQLScriptAtomicExecutorMixin from masu.database import OCI_CUR_TABLE_MAP from masu.database.report_db_accessor_base import ReportDBAccessorBase -from masu.processor import is_feature_cost_3592_tag_mapping_enabled from reporting.provider.all.models import TagMapping from reporting.provider.oci.models import OCICostEntryBill from reporting.provider.oci.models import OCICostEntryLineItemDailySummary @@ -133,8 +132,6 @@ def update_line_item_daily_summary_with_tag_mapping(self, start_date, end_date, Returns: (None) """ - if not is_feature_cost_3592_tag_mapping_enabled(self.schema): - return with schema_context(self.schema): # Early return check to see if they have any tag mappings set. if not TagMapping.objects.filter(child__provider_type=Provider.PROVIDER_OCI).exists(): diff --git a/koku/masu/database/ocp_report_db_accessor.py b/koku/masu/database/ocp_report_db_accessor.py index 76725f7e9c..3f851ea989 100644 --- a/koku/masu/database/ocp_report_db_accessor.py +++ b/koku/masu/database/ocp_report_db_accessor.py @@ -26,7 +26,6 @@ from koku.trino_database import TrinoStatementExecError from masu.database import OCP_REPORT_TABLE_MAP from masu.database.report_db_accessor_base import ReportDBAccessorBase -from masu.processor import is_feature_cost_3592_tag_mapping_enabled from masu.util.common import filter_dictionary from masu.util.common import trino_table_exists from masu.util.gcp.common import check_resource_level @@ -106,8 +105,6 @@ def update_line_item_daily_summary_with_tag_mapping(self, start_date, end_date, Returns (None) """ - if not is_feature_cost_3592_tag_mapping_enabled(self.schema): - return with schema_context(self.schema): # Early return check to see if they have any tag mappings set. if not TagMapping.objects.filter(child__provider_type=Provider.PROVIDER_OCP).exists(): diff --git a/koku/masu/processor/__init__.py b/koku/masu/processor/__init__.py index 197b8c9fad..439c5d60e5 100644 --- a/koku/masu/processor/__init__.py +++ b/koku/masu/processor/__init__.py @@ -177,14 +177,6 @@ def is_feature_unattributed_storage_enabled_aws(account): return UNLEASH_CLIENT.is_enabled(unleash_flag, context, fallback_development_true) -def is_feature_cost_3592_tag_mapping_enabled(account): - """Should tag mapping be enabled.""" - unleash_flag = "cost-management.backend.feature-cost-3592-tag-mapping" - account = convert_account(account) - context = {"schema": account} - return UNLEASH_CLIENT.is_enabled(unleash_flag, context, fallback_development_true) - - def is_feature_cost_4403_ec2_compute_cost_enabled(account): # pragma: no cover """Should EC2 individual VM compute cost be enabled.""" unleash_flag = "cost-management.backend.feature-4403-enable-ec2-compute-processing" diff --git a/koku/masu/test/database/test_aws_report_db_accessor.py b/koku/masu/test/database/test_aws_report_db_accessor.py index 26a974c21a..3d71e4d9ed 100644 --- a/koku/masu/test/database/test_aws_report_db_accessor.py +++ b/koku/masu/test/database/test_aws_report_db_accessor.py @@ -408,13 +408,11 @@ def test_delete_aws_hive_partition_by_month(self, mock_trino, mock_table_exist): mock_trino.assert_not_called() mock_table_exist.assert_not_called() - @patch("masu.database.aws_report_db_accessor.is_feature_cost_3592_tag_mapping_enabled") - def test_update_line_item_daily_summary_with_tag_mapping(self, mock_unleash): + def test_update_line_item_daily_summary_with_tag_mapping(self): """ Test that mapped tags are updated in aws line item summary tables. After the update, the child tag's key-value data is cleared and the parent tag's data is updated accordingly. """ - mock_unleash.return_value = True populated_keys = [] table_classes = [AWSCostEntryLineItemDailySummary, AWSCostEntryLineItemSummaryByEC2ComputeP] @@ -459,12 +457,10 @@ def test_update_line_item_daily_summary_with_tag_mapping(self, mock_unleash): # Clear TagMapping objects TagMapping.objects.filter(parent=parent_obj, child=child_obj).delete() - @patch("masu.database.aws_report_db_accessor.is_feature_cost_3592_tag_mapping_enabled") - def test_populate_ocp_on_aws_tag_information(self, mock_unleash): + def test_populate_ocp_on_aws_tag_information(self): """ This tests the tag mapping feature. """ - mock_unleash.return_value = True populated_keys = [] report_period_id = 1 with schema_context(self.schema): diff --git a/koku/masu/test/database/test_azure_report_db_accessor.py b/koku/masu/test/database/test_azure_report_db_accessor.py index 677e21ca3f..57fb3d0326 100644 --- a/koku/masu/test/database/test_azure_report_db_accessor.py +++ b/koku/masu/test/database/test_azure_report_db_accessor.py @@ -348,12 +348,10 @@ def test_delete_ocp_on_azure_hive_partition_by_day_managed_table( mock_connect.assert_called() self.assertEqual(mock_connect.call_count, settings.HIVE_PARTITION_DELETE_RETRIES) - @patch("masu.database.azure_report_db_accessor.is_feature_cost_3592_tag_mapping_enabled") - def test_update_line_item_daily_summary_with_tag_mapping(self, mock_unleash): + def test_update_line_item_daily_summary_with_tag_mapping(self): """ This tests the tag mapping feature. """ - mock_unleash.return_value = True populated_keys = [] with schema_context(self.schema): enabled_tags = EnabledTagKeys.objects.filter(provider_type=Provider.PROVIDER_AZURE, enabled=True) @@ -382,12 +380,10 @@ def test_update_line_item_daily_summary_with_tag_mapping(self, mock_unleash): ).count() self.assertEqual(0, actual_child_count) - @patch("masu.database.azure_report_db_accessor.is_feature_cost_3592_tag_mapping_enabled") - def test_populate_ocp_on_azure_tag_information(self, mock_unleash): + def test_populate_ocp_on_azure_tag_information(self): """ This tests the tag mapping feature. """ - mock_unleash.return_value = True populated_keys = [] report_period_id = 1 with schema_context(self.schema): diff --git a/koku/masu/test/database/test_gcp_report_db_accessor.py b/koku/masu/test/database/test_gcp_report_db_accessor.py index c4d1aa7f6b..dce1a4a35d 100644 --- a/koku/masu/test/database/test_gcp_report_db_accessor.py +++ b/koku/masu/test/database/test_gcp_report_db_accessor.py @@ -494,12 +494,10 @@ def test_delete_ocp_on_gcp_hive_partition_by_day_managed_table( mock_connect.assert_called() self.assertEqual(mock_connect.call_count, settings.HIVE_PARTITION_DELETE_RETRIES) - @patch("masu.database.gcp_report_db_accessor.is_feature_cost_3592_tag_mapping_enabled") - def test_update_line_item_daily_summary_with_tag_mapping(self, mock_unleash): + def test_update_line_item_daily_summary_with_tag_mapping(self): """ This tests the tag mapping feature. """ - mock_unleash.return_value = True populated_keys = [] with schema_context(self.schema): enabled_tags = EnabledTagKeys.objects.filter(provider_type=Provider.PROVIDER_GCP, enabled=True) @@ -528,12 +526,10 @@ def test_update_line_item_daily_summary_with_tag_mapping(self, mock_unleash): ).count() self.assertEqual(0, actual_child_count) - @patch("masu.database.gcp_report_db_accessor.is_feature_cost_3592_tag_mapping_enabled") - def test_populate_ocp_on_gcp_tag_information(self, mock_unleash): + def test_populate_ocp_on_gcp_tag_information(self): """ This tests the tag mapping feature. """ - mock_unleash.return_value = True populated_keys = [] report_period_id = 1 with schema_context(self.schema): diff --git a/koku/masu/test/database/test_oci_report_db_accessor.py b/koku/masu/test/database/test_oci_report_db_accessor.py index be3bc72135..5e31064733 100644 --- a/koku/masu/test/database/test_oci_report_db_accessor.py +++ b/koku/masu/test/database/test_oci_report_db_accessor.py @@ -163,12 +163,10 @@ def test_table_properties(self): def test_table_map(self): self.assertEqual(self.accessor._table_map, OCI_CUR_TABLE_MAP) - @patch("masu.database.oci_report_db_accessor.is_feature_cost_3592_tag_mapping_enabled") - def test_update_line_item_daily_summary_with_tag_mapping(self, mock_unleash): + def test_update_line_item_daily_summary_with_tag_mapping(self): """ This tests the tag mapping feature. """ - mock_unleash.return_value = True populated_keys = [] with schema_context(self.schema): enabled_tags = EnabledTagKeys.objects.filter(provider_type=Provider.PROVIDER_OCI, enabled=True) diff --git a/koku/masu/test/database/test_ocp_report_db_accessor.py b/koku/masu/test/database/test_ocp_report_db_accessor.py index 6610e6ff0f..7856412df2 100644 --- a/koku/masu/test/database/test_ocp_report_db_accessor.py +++ b/koku/masu/test/database/test_ocp_report_db_accessor.py @@ -1027,12 +1027,10 @@ def get_pkgutil_values(file): mock_sql_execute.assert_called() self.assertEqual(len(mock_sql_execute.call_args_list), 4) - @patch("masu.database.ocp_report_db_accessor.is_feature_cost_3592_tag_mapping_enabled") - def test_update_line_item_daily_summary_with_tag_mapping(self, mock_unleash): + def test_update_line_item_daily_summary_with_tag_mapping(self): """ This tests the tag mapping feature. """ - mock_unleash.return_value = True populated_keys = [] with schema_context(self.schema): enabled_tags = EnabledTagKeys.objects.filter(provider_type=Provider.PROVIDER_OCP, enabled=True)