diff --git a/local-app/python-tools/gfl-resource-actions/managers/base.py b/local-app/python-tools/gfl-resource-actions/managers/base.py index 787eff14..6842eb4b 100644 --- a/local-app/python-tools/gfl-resource-actions/managers/base.py +++ b/local-app/python-tools/gfl-resource-actions/managers/base.py @@ -2,9 +2,10 @@ Base resource manager class that provides common functionality. """ import datetime -from aws_utils import create_boto3_client_for_account, get_partition_for_region +import boto3 import config -from logging_utils import setup_logging +from aws_utils import get_partition_for_region +from logging_utils import setup_logging, log_action_to_csv logger = setup_logging() @@ -38,6 +39,7 @@ def create_client(self, service, region): aws_session_token=self.credentials['SessionToken'] ) + # Use aws_utils function directly rather than duplicating logic def get_partition_for_region(self, region): """Get AWS partition for the specified region.""" return get_partition_for_region(region) @@ -86,6 +88,7 @@ def log_action(self, resource_id, region, action, resource_name=None, details=No if existing_schedule: message += f" (Schedule: {existing_schedule})" + # Use logging_utils.log_action_to_csv for consistent CSV logging across the application log_action_to_csv( account_id=self.account_id, account_name=self.account_name,