diff --git a/src/coldfront_plugin_cloud/management/commands/convert_swift_quota_to_gib.py b/src/coldfront_plugin_cloud/management/commands/convert_swift_quota_to_gib.py index a9d46eff..3d92028c 100644 --- a/src/coldfront_plugin_cloud/management/commands/convert_swift_quota_to_gib.py +++ b/src/coldfront_plugin_cloud/management/commands/convert_swift_quota_to_gib.py @@ -8,6 +8,7 @@ from coldfront.core.resource.models import Resource, ResourceType from coldfront.core.allocation.models import Allocation, AllocationStatusChoice +logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) diff --git a/src/coldfront_plugin_cloud/management/commands/count_gpu_usage.py b/src/coldfront_plugin_cloud/management/commands/count_gpu_usage.py index 74c791fd..027c3327 100644 --- a/src/coldfront_plugin_cloud/management/commands/count_gpu_usage.py +++ b/src/coldfront_plugin_cloud/management/commands/count_gpu_usage.py @@ -9,7 +9,7 @@ from coldfront.core.resource.models import Resource, ResourceType from coldfront.core.allocation.models import Allocation, AllocationStatusChoice - +logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) diff --git a/src/coldfront_plugin_cloud/management/commands/list_cloud_allocations.py b/src/coldfront_plugin_cloud/management/commands/list_cloud_allocations.py index aff7d346..e5004c73 100644 --- a/src/coldfront_plugin_cloud/management/commands/list_cloud_allocations.py +++ b/src/coldfront_plugin_cloud/management/commands/list_cloud_allocations.py @@ -10,7 +10,7 @@ from coldfront.core.resource.models import Resource, ResourceType from coldfront.core.allocation.models import Allocation, AllocationStatusChoice - +logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) diff --git a/src/coldfront_plugin_cloud/management/commands/migrate_fields_of_science.py b/src/coldfront_plugin_cloud/management/commands/migrate_fields_of_science.py index f2b37b47..5ca48895 100644 --- a/src/coldfront_plugin_cloud/management/commands/migrate_fields_of_science.py +++ b/src/coldfront_plugin_cloud/management/commands/migrate_fields_of_science.py @@ -6,7 +6,7 @@ import logging - +logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) @@ -56,7 +56,7 @@ def _load_fos_map(mapping_csv): def _validate_old_fos(mapping_dict): for old_fos_name in list(mapping_dict.keys()): if not FieldOfScience.objects.filter(description=old_fos_name): - logger.warn(f"Old field of science {old_fos_name} does not exist") + logger.warning(f"Old field of science {old_fos_name} does not exist") @staticmethod def _create_new_fos(new_fos_set): diff --git a/src/coldfront_plugin_cloud/management/commands/register_cloud_attributes.py b/src/coldfront_plugin_cloud/management/commands/register_cloud_attributes.py index 94effebe..c0bf235e 100644 --- a/src/coldfront_plugin_cloud/management/commands/register_cloud_attributes.py +++ b/src/coldfront_plugin_cloud/management/commands/register_cloud_attributes.py @@ -7,6 +7,7 @@ from coldfront_plugin_cloud import attributes +logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) diff --git a/src/coldfront_plugin_cloud/management/commands/validate_allocations.py b/src/coldfront_plugin_cloud/management/commands/validate_allocations.py index dfe9ef14..9eae7272 100644 --- a/src/coldfront_plugin_cloud/management/commands/validate_allocations.py +++ b/src/coldfront_plugin_cloud/management/commands/validate_allocations.py @@ -15,7 +15,7 @@ ) from keystoneauth1.exceptions import http - +logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) STATES_TO_VALIDATE = ["Active", "Active (Needs Renewal)"] @@ -43,7 +43,7 @@ def sync_users(project_id, allocation, allocator, apply): for coldfront_user in coldfront_users: if coldfront_user.user.username not in allocation_users: failed_validation = True - logger.warn( + logger.warning( f"{coldfront_user.user.username} is not part of {project_id}" ) if apply: @@ -56,7 +56,7 @@ def sync_users(project_id, allocation, allocator, apply): for allocation_user in allocation_users: if allocation_user not in users: failed_validation = True - logger.warn( + logger.warning( f"{allocation_user} exists in the resource {project_id} but not in coldfront" ) if apply: @@ -97,10 +97,10 @@ def check_institution_specific_code(self, allocation, apply): if not isc: alloc_str = f'{allocation.pk} of project "{allocation.project.title}"' msg = f'Attribute "{attr}" missing on allocation {alloc_str}' - logger.warn(msg) + logger.warning(msg) if apply: utils.set_attribute_on_allocation(allocation, attr, "N/A") - logger.warn(f'Attribute "{attr}" added to allocation {alloc_str}') + logger.warning(f'Attribute "{attr}" added to allocation {alloc_str}') def handle(self, *args, **options): # Deal with Openstack and ESI resources