diff --git a/src/spaceone/cost_analysis/manager/data_source_rule_manager.py b/src/spaceone/cost_analysis/manager/data_source_rule_manager.py index 8519497b..d84111bc 100644 --- a/src/spaceone/cost_analysis/manager/data_source_rule_manager.py +++ b/src/spaceone/cost_analysis/manager/data_source_rule_manager.py @@ -157,10 +157,6 @@ def _change_cost_data_with_actions( target_value = utils.get_dict_value(cost_data, source) all_workspaces = value.get("all_workspaces", False) - _LOGGER.debug( - [source, target_key, target_value, all_workspaces] - ) # todo: remove - if all_workspaces: workspace_id = None @@ -168,9 +164,7 @@ def _change_cost_data_with_actions( service_account_info = self._get_service_account( target_key, target_value, domain_id, workspace_id ) - _LOGGER.debug( - f"service_account_info: {service_account_info}" - ) # todo: remove + if service_account_info: cost_data["service_account_id"] = service_account_info[ "service_account_id" @@ -180,6 +174,10 @@ def _change_cost_data_with_actions( cost_data["workspace_id"] = service_account_info.get( "workspace_id" ) + elif all_workspaces: + cost_data["workspace_id"] = service_account_info.get( + "workspace_id" + ) if action == "add_additional_info" and value: cost_data["additional_info"] = cost_data.get("additional_info", {})