Fix up logger .warn() calls to use .warning() instead

This is a usage that was deprecated in Python 3.0.
This commit is contained in:
Jeff Bradberry
2022-01-31 13:17:45 -05:00
parent a3a216f91f
commit b852baaa39
28 changed files with 65 additions and 65 deletions

View File

@@ -247,7 +247,7 @@ class Instance(HasPolicyEditsMixin, BaseModel):
if uuid is not None and self.uuid != uuid:
if self.uuid is not None:
logger.warn(f'Self-reported uuid of {self.hostname} changed from {self.uuid} to {uuid}')
logger.warning(f'Self-reported uuid of {self.hostname} changed from {self.uuid} to {uuid}')
self.uuid = uuid
update_fields.append('uuid')

View File

@@ -515,7 +515,7 @@ class JobNotificationMixin(object):
try:
notification_templates = self.get_notification_templates()
except Exception:
logger.warn("No notification template defined for emitting notification")
logger.warning("No notification template defined for emitting notification")
return
if not notification_templates:

View File

@@ -103,7 +103,7 @@ class Schedule(PrimordialModel, LaunchTimeConfig):
for zone in all_zones:
if fname.endswith(zone):
return zone
logger.warn('Could not detect valid zoneinfo for {}'.format(self.rrule))
logger.warning('Could not detect valid zoneinfo for {}'.format(self.rrule))
return ''
@property

View File

@@ -357,7 +357,7 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique, ExecutionEn
validated_kwargs = kwargs.copy()
if unallowed_fields:
if parent_field_name is None:
logger.warn('Fields {} are not allowed as overrides to spawn from {}.'.format(', '.join(unallowed_fields), self))
logger.warning('Fields {} are not allowed as overrides to spawn from {}.'.format(', '.join(unallowed_fields), self))
for f in unallowed_fields:
validated_kwargs.pop(f)
@@ -1205,7 +1205,7 @@ class UnifiedJob(
try:
extra_data_dict = parse_yaml_or_json(extra_data, silent_failure=False)
except Exception as e:
logger.warn("Exception deserializing extra vars: " + str(e))
logger.warning("Exception deserializing extra vars: " + str(e))
evars = self.extra_vars_dict
evars.update(extra_data_dict)
self.update_fields(extra_vars=json.dumps(evars))