diff --git a/contrib/archive/backends/impl_ipa/auth.py b/contrib/archive/backends/impl_ipa/auth.py index 299212387..b12096cc9 100644 --- a/contrib/archive/backends/impl_ipa/auth.py +++ b/contrib/archive/backends/impl_ipa/auth.py @@ -38,7 +38,7 @@ class IPAAuth(auth.AuthBase): if self.keytab: os.environ['KRB5_CLIENT_KTNAME'] = self.keytab else: - LOG.warn(_LW('No IPA client kerberos keytab file given')) + LOG.warning(_LW('No IPA client kerberos keytab file given')) def __call__(self, request): if not self.token: diff --git a/contrib/ipaextractor.py b/contrib/ipaextractor.py index 5dbc666df..0d1fe5262 100644 --- a/contrib/ipaextractor.py +++ b/contrib/ipaextractor.py @@ -177,7 +177,7 @@ def syncipaservers2des(servers, designatereq, designateurl): for srec in resp.json()['servers']: dservers[srec['name']] = srec['id'] else: - LOG.warn(_LW("No servers in designate")) + LOG.warning(_LW("No servers in designate")) # first - add servers from ipa not already in designate for server in servers: diff --git a/designate/agent/handler.py b/designate/agent/handler.py index d3510c56a..3c10d1b95 100644 --- a/designate/agent/handler.py +++ b/designate/agent/handler.py @@ -117,7 +117,7 @@ class RequestHandler(object): serial = self.backend.find_zone_serial(zone_name) if serial is not None: - LOG.warn(_LW("Not creating %(name)s, zone already exists") % + LOG.warning(_LW("Not creating %(name)s, zone already exists") % {'name': zone_name}) # Provide an authoritative answer response.flags |= dns.flags.AA @@ -161,7 +161,7 @@ class RequestHandler(object): serial = self.backend.find_zone_serial(zone_name) if serial is None: - LOG.warn(_LW("Refusing NOTIFY for %(name)s, doesn't exist") % + LOG.warning(_LW("Refusing NOTIFY for %(name)s, doesn't exist") % {'name': zone_name}) response.set_rcode(dns.rcode.from_text("REFUSED")) return response @@ -212,7 +212,7 @@ class RequestHandler(object): serial = self.backend.find_zone_serial(zone_name) if serial is None: - LOG.warn(_LW("Not deleting %(name)s, zone doesn't exist") % + LOG.warning(_LW("Not deleting %(name)s, zone doesn't exist") % {'name': zone_name}) # Provide an authoritative answer response.flags |= dns.flags.AA @@ -239,7 +239,7 @@ class RequestHandler(object): return True if requester not in self.allow_notify: - LOG.warn(_LW("%(verb)s for %(name)s from %(server)s refused") % + LOG.warning(_LW("%(verb)s for %(name)s from %(server)s refused") % {'verb': op, 'name': zone_name, 'server': requester}) return False diff --git a/designate/api/middleware.py b/designate/api/middleware.py index 0509ada4d..626d5863b 100644 --- a/designate/api/middleware.py +++ b/designate/api/middleware.py @@ -215,7 +215,7 @@ class MaintenanceMiddleware(base.Middleware): # If the caller has the bypass role, let them through if ('context' in request.environ and self.role in request.environ['context'].roles): - LOG.warn(_LW('Request authorized to bypass maintenance mode')) + LOG.warning(_LW('Request authorized to bypass maintenance mode')) return None # Otherwise, reject the request with a 503 Service Unavailable diff --git a/designate/backend/agent.py b/designate/backend/agent.py index cc6ff5c04..75728e386 100644 --- a/designate/backend/agent.py +++ b/designate/backend/agent.py @@ -127,7 +127,7 @@ class AgentPoolBackend(base.Backend): dns_message, dest_ip, dest_port, timeout) if isinstance(response, dns.exception.Timeout): - LOG.warn(_LW("Got Timeout while trying to send '%(msg)s' for " + LOG.warning(_LW("Got Timeout while trying to send '%(msg)s' for " "'%(zone)s' to '%(server)s:%(port)d'. Timeout=" "'%(timeout)d' seconds. Retry='%(retry)d'") % {'msg': str(opcode), @@ -136,7 +136,7 @@ class AgentPoolBackend(base.Backend): 'retry': retry}) response = None elif isinstance(response, dns_query.BadResponse): - LOG.warn(_LW("Got BadResponse while trying to send '%(msg)s' " + LOG.warning(_LW("Got BadResponse while trying to send '%(msg)s' " "for '%(zone)s' to '%(server)s:%(port)d'. Timeout" "='%(timeout)d' seconds. Retry='%(retry)d'") % {'msg': str(opcode), @@ -149,7 +149,7 @@ class AgentPoolBackend(base.Backend): # authoritative answer elif not (response.flags & dns.flags.AA) or dns.rcode.from_flags( response.flags, response.ednsflags) != dns.rcode.NOERROR: - LOG.warn(_LW("Failed to get expected response while trying to " + LOG.warning(_LW("Failed to get expected response while trying to " "send '%(msg)s' for '%(zone)s' to '%(server)s:" "%(port)d'. Response message: %(resp)s") % {'msg': str(opcode), diff --git a/designate/backend/impl_designate.py b/designate/backend/impl_designate.py index 1ed23438a..d3f53bb02 100644 --- a/designate/backend/impl_designate.py +++ b/designate/backend/impl_designate.py @@ -103,4 +103,4 @@ class DesignateBackend(base.Backend): self.client.zones.delete(zone.name) except exceptions.NotFound: msg = _LW("Zone %s not found on remote Designate, Ignoring") - LOG.warn(msg, zone.id) + LOG.warning(msg, zone.id) diff --git a/designate/backend/impl_dynect.py b/designate/backend/impl_dynect.py index d09b2617a..89235d4b8 100644 --- a/designate/backend/impl_dynect.py +++ b/designate/backend/impl_dynect.py @@ -386,7 +386,7 @@ class DynECTBackend(base.Backend): client.delete(url) except DynClientError as e: if e.http_status == 404: - LOG.warn(_LW("Attempt to delete %(d_id)s / %(d_name)s " + LOG.warning(_LW("Attempt to delete %(d_id)s / %(d_name)s " "caused 404, ignoring.") % {'d_id': zone['id'], 'd_name': zone['name']}) pass diff --git a/designate/backend/impl_powerdns/migrate_repo/versions/006_add_inherit_ttl_col.py b/designate/backend/impl_powerdns/migrate_repo/versions/006_add_inherit_ttl_col.py index 68045897f..3ff167757 100644 --- a/designate/backend/impl_powerdns/migrate_repo/versions/006_add_inherit_ttl_col.py +++ b/designate/backend/impl_powerdns/migrate_repo/versions/006_add_inherit_ttl_col.py @@ -53,8 +53,8 @@ def upgrade(migrate_engine): 'dns.records.ttl = designate.domains.ttl WHERE powerdns.records' '.inherit_ttl = 1;') - LOG.warn(_LW('**** A manual post-migration step is required ****')) - LOG.warn(_LW('Please issue this query: %s' % pmq)) + LOG.warning(_LW('**** A manual post-migration step is required ****')) + LOG.warning(_LW('Please issue this query: %s' % pmq)) def downgrade(migrate_engine): diff --git a/designate/backend/impl_powerdns/migrate_repo/versions/011_records_drop_designate_ids.py b/designate/backend/impl_powerdns/migrate_repo/versions/011_records_drop_designate_ids.py index afd413961..5f628e2d2 100644 --- a/designate/backend/impl_powerdns/migrate_repo/versions/011_records_drop_designate_ids.py +++ b/designate/backend/impl_powerdns/migrate_repo/versions/011_records_drop_designate_ids.py @@ -29,7 +29,7 @@ meta = MetaData() def upgrade(migrate_engine): meta.bind = migrate_engine - LOG.warn(_LW('It will not be possible to downgrade from schema #11')) + LOG.warning(_LW('It will not be possible to downgrade from schema #11')) records_table = Table('records', meta, autoload=True) records_table.c.designate_id.drop() diff --git a/designate/central/service.py b/designate/central/service.py index 9092a20eb..de56db7ee 100644 --- a/designate/central/service.py +++ b/designate/central/service.py @@ -65,7 +65,7 @@ def _retry_on_deadlock(exc): # TODO(kiall): This is a total leak of the SQLA Driver, we'll need a better # way to handle this. if isinstance(exc, db_exception.DBDeadlock): - LOG.warn(_LW("Deadlock detected. Retrying...")) + LOG.warning(_LW("Deadlock detected. Retrying...")) return True return False @@ -294,7 +294,7 @@ class Service(service.RPCService, service.Service): if (cfg.CONF['service:central'].managed_resource_tenant_id == "00000000-0000-0000-0000-000000000000"): msg = _LW("Managed Resource Tenant ID is not properly configured") - LOG.warn(msg) + LOG.warning(msg) super(Service, self).start() diff --git a/designate/coordination.py b/designate/coordination.py index 2b05e31d5..95ab08bfa 100644 --- a/designate/coordination.py +++ b/designate/coordination.py @@ -74,7 +74,7 @@ class CoordinationMixin(object): msg = _LW("No coordination backend configured, distributed " "coordination functionality will be disabled. " "Please configure a coordination backend.") - LOG.warn(msg) + LOG.warning(msg) super(CoordinationMixin, self).start() diff --git a/designate/mdns/handler.py b/designate/mdns/handler.py index e107e5ebb..27503c9c8 100644 --- a/designate/mdns/handler.py +++ b/designate/mdns/handler.py @@ -132,7 +132,7 @@ class RequestHandler(xfr.XFRMixin): if not master_addr: msg = _LW("NOTIFY for %(name)s from non-master server " "%(addr)s, ignoring.") - LOG.warn(msg % {"name": zone.name, "addr": notify_addr}) + LOG.warning(msg % {"name": zone.name, "addr": notify_addr}) response.set_rcode(dns.rcode.REFUSED) yield response raise StopIteration diff --git a/designate/mdns/notify.py b/designate/mdns/notify.py index 174121cda..beb893196 100644 --- a/designate/mdns/notify.py +++ b/designate/mdns/notify.py @@ -132,7 +132,7 @@ class NotifyEndpoint(base.BaseEndpoint): if actual_serial is None or actual_serial < zone.serial: # TODO(vinod): Account for serial number wrap around. retries = retries - retry - LOG.warn(_LW("Got lower serial for '%(zone)s' to '%(host)s:" + LOG.warning(_LW("Got lower serial for '%(zone)s' to '%(host)s:" "%(port)s'. Expected:'%(es)d'. Got:'%(as)s'." "Retries left='%(retries)d'") % {'zone': zone.name, 'host': host, @@ -186,25 +186,27 @@ class NotifyEndpoint(base.BaseEndpoint): dns_message, host, port, timeout) if isinstance(response, dns.exception.Timeout): - LOG.warn(_LW("Got Timeout while trying to send '%(msg)s' for " - "'%(zone)s' to '%(server)s:%(port)d'. Timeout=" - "'%(timeout)d' seconds. Retry='%(retry)d'") % - {'msg': 'NOTIFY' if notify else 'SOA', - 'zone': zone.name, 'server': host, - 'port': port, 'timeout': timeout, - 'retry': retry}) + LOG.warning( + _LW("Got Timeout while trying to send '%(msg)s' for " + "'%(zone)s' to '%(server)s:%(port)d'. Timeout=" + "'%(timeout)d' seconds. Retry='%(retry)d'") % + {'msg': 'NOTIFY' if notify else 'SOA', + 'zone': zone.name, 'server': host, + 'port': port, 'timeout': timeout, + 'retry': retry}) response = None # retry sending the message if we get a Timeout. time.sleep(retry_interval) continue elif isinstance(response, dns_query.BadResponse): - LOG.warn(_LW("Got BadResponse while trying to send '%(msg)s' " - "for '%(zone)s' to '%(server)s:%(port)d'. Timeout" - "='%(timeout)d' seconds. Retry='%(retry)d'") % - {'msg': 'NOTIFY' if notify else 'SOA', - 'zone': zone.name, 'server': host, - 'port': port, 'timeout': timeout, - 'retry': retry}) + LOG.warning( + _LW("Got BadResponse while trying to send '%(msg)s' " + "for '%(zone)s' to '%(server)s:%(port)d'. Timeout" + "='%(timeout)d' seconds. Retry='%(retry)d'") % + {'msg': 'NOTIFY' if notify else 'SOA', + 'zone': zone.name, 'server': host, + 'port': port, 'timeout': timeout, + 'retry': retry}) response = None break # Check that we actually got a NOERROR in the rcode and and an @@ -217,12 +219,13 @@ class NotifyEndpoint(base.BaseEndpoint): break elif not (response.flags & dns.flags.AA) or dns.rcode.from_flags( response.flags, response.ednsflags) != dns.rcode.NOERROR: - LOG.warn(_LW("Failed to get expected response while trying to " - "send '%(msg)s' for '%(zone)s' to '%(server)s:" - "%(port)d'.\nResponse message:\n%(resp)s\n") % - {'msg': 'NOTIFY' if notify else 'SOA', - 'zone': zone.name, 'server': host, - 'port': port, 'resp': str(response)}) + LOG.warning( + _LW("Failed to get expected response while trying to " + "send '%(msg)s' for '%(zone)s' to '%(server)s:" + "%(port)d'.\nResponse message:\n%(resp)s\n") % + {'msg': 'NOTIFY' if notify else 'SOA', + 'zone': zone.name, 'server': host, + 'port': port, 'resp': str(response)}) response = None break else: diff --git a/designate/network_api/neutron.py b/designate/network_api/neutron.py index b4b5e8275..afdd84728 100644 --- a/designate/network_api/neutron.py +++ b/designate/network_api/neutron.py @@ -118,7 +118,7 @@ class NeutronNetworkAPI(NetworkAPI): # NOTE: 401 might be that the user doesn't have neutron # activated in a particular region, we'll just log the failure # and go on with our lives. - LOG.warn(_LW("Calling Neutron resulted in a 401, " + LOG.warning(_LW("Calling Neutron resulted in a 401, " "please investigate.")) LOG.exception(e) return diff --git a/designate/pool_manager/service.py b/designate/pool_manager/service.py index 0095162e6..966682451 100644 --- a/designate/pool_manager/service.py +++ b/designate/pool_manager/service.py @@ -272,7 +272,7 @@ class Service(service.RPCService, coordination.CoordinationMixin, else: - LOG.warn(_LW('Consensus not reached for creating zone %(zone)s' + LOG.warning(_LW('Consensus not reached for creating zone %(zone)s' ' on pool targets') % {'zone': zone.name}) self.central_api.update_status( @@ -342,7 +342,7 @@ class Service(service.RPCService, coordination.CoordinationMixin, success_count += 1 if not self._exceed_or_meet_threshold(success_count): - LOG.warn(_LW('Consensus not reached for updating zone %(zone)s' + LOG.warning(_LW('Consensus not reached for updating zone %(zone)s' ' on pool targets') % {'zone': zone.name}) self.central_api.update_status(context, zone.id, ERROR_STATUS, zone.serial) @@ -430,7 +430,7 @@ class Service(service.RPCService, coordination.CoordinationMixin, context, zone.id, SUCCESS_STATUS, zone.serial) else: - LOG.warn(_LW('Consensus not reached for deleting zone %(zone)s' + LOG.warning(_LW('Consensus not reached for deleting zone %(zone)s' ' on pool targets') % {'zone': zone.name}) self.central_api.update_status( @@ -524,7 +524,7 @@ class Service(service.RPCService, coordination.CoordinationMixin, error_serial = self._get_error_serial( context, zone, consensus_serial) if error_serial > consensus_serial or error_serial == 0: - LOG.warn(_LW('For zone %(zone)s ' + LOG.warning(_LW('For zone %(zone)s ' 'the error serial is %(error_serial)s.') % {'zone': zone.name, 'error_serial': error_serial}) @@ -532,7 +532,7 @@ class Service(service.RPCService, coordination.CoordinationMixin, context, zone.id, ERROR_STATUS, error_serial) if status == NO_ZONE_STATUS and action != DELETE_ACTION: - LOG.warn(_LW('Zone %(zone)s is not present in some ' + LOG.warning(_LW('Zone %(zone)s is not present in some ' 'targets') % {'zone': zone.name}) self.central_api.update_status( context, zone.id, NO_ZONE_STATUS, 0) diff --git a/designate/service.py b/designate/service.py index 490cf66f3..5a94426c2 100644 --- a/designate/service.py +++ b/designate/service.py @@ -267,17 +267,18 @@ class DNSService(object): except socket.error as e: client.close() errname = errno.errorcode[e.args[0]] - LOG.warn(_LW("Socket error %(err)s from: %(host)s:%(port)d") % - {'host': addr[0], 'port': addr[1], 'err': errname}) + LOG.warning( + _LW("Socket error %(err)s from: %(host)s:%(port)d") % + {'host': addr[0], 'port': addr[1], 'err': errname}) except socket.timeout: client.close() - LOG.warn(_LW("TCP Timeout from: %(host)s:%(port)d") % + LOG.warning(_LW("TCP Timeout from: %(host)s:%(port)d") % {'host': addr[0], 'port': addr[1]}) except struct.error: client.close() - LOG.warn(_LW("Invalid packet from: %(host)s:%(port)d") % + LOG.warning(_LW("Invalid packet from: %(host)s:%(port)d") % {'host': addr[0], 'port': addr[1]}) except Exception: @@ -308,8 +309,9 @@ class DNSService(object): except socket.error as e: errname = errno.errorcode[e.args[0]] - LOG.warn(_LW("Socket error %(err)s from: %(host)s:%(port)d") % - {'host': addr[0], 'port': addr[1], 'err': errname}) + LOG.warning( + _LW("Socket error %(err)s from: %(host)s:%(port)d") % + {'host': addr[0], 'port': addr[1], 'err': errname}) except Exception: LOG.exception(_LE("Unknown exception handling UDP request " diff --git a/designate/sink/service.py b/designate/sink/service.py index 8c21ec3cd..f957fcbd5 100644 --- a/designate/sink/service.py +++ b/designate/sink/service.py @@ -49,7 +49,7 @@ class Service(service.Service): enabled_notification_handlers) if len(notification_handlers) == 0: - LOG.warn(_LW('No designate-sink handlers enabled or loaded')) + LOG.warning(_LW('No designate-sink handlers enabled or loaded')) return notification_handlers diff --git a/designate/storage/impl_sqlalchemy/migrate_repo/versions/068_add_shard_column.py b/designate/storage/impl_sqlalchemy/migrate_repo/versions/068_add_shard_column.py index 0cef1b00e..6f9bae391 100644 --- a/designate/storage/impl_sqlalchemy/migrate_repo/versions/068_add_shard_column.py +++ b/designate/storage/impl_sqlalchemy/migrate_repo/versions/068_add_shard_column.py @@ -90,7 +90,7 @@ def upgrade(migrate_engine): # try again msg = i18n._LW( "Updating migration for sharding failed, retrying.") - LOG.warn(msg) + LOG.warning(msg) if i >= 4: # Raise if we've reached max attempts causing migration to # fail