← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3-logger-warning into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3-logger-warning into launchpad:master.

Commit message:
Use Logger.warning rather than Logger.warn

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/396193

Fixes a DeprecationWarning on Python >= 3.3.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-logger-warning into launchpad:master.
diff --git a/database/schema/dbcontroller.py b/database/schema/dbcontroller.py
index 4b92935..77bdc22 100644
--- a/database/schema/dbcontroller.py
+++ b/database/schema/dbcontroller.py
@@ -62,7 +62,8 @@ class DBController:
         if not pgbouncer_conn_str.dbname:
             pgbouncer_conn_str.dbname = 'pgbouncer'
         if pgbouncer_conn_str.dbname != 'pgbouncer':
-            log.warn("pgbouncer administrative database not named 'pgbouncer'")
+            log.warning(
+                "pgbouncer administrative database not named 'pgbouncer'")
         self.pgbouncer_con = pg_connect(pgbouncer_conn_str)
 
         self.master_name = None
@@ -143,7 +144,8 @@ class DBController:
                 cur.execute("SELECT pg_is_wal_replay_paused()")
                 replication_paused = cur.fetchone()[0]
                 if replication_paused:
-                    self.log.warn("Replication paused on %s. Resuming.", name)
+                    self.log.warning(
+                        "Replication paused on %s. Resuming.", name)
                     cur.execute("SELECT pg_wal_replay_resume()")
                     wait_for_sync = True
             except psycopg2.Error as x:
diff --git a/database/schema/full-update.py b/database/schema/full-update.py
index 18ec743..ba1b4d0 100755
--- a/database/schema/full-update.py
+++ b/database/schema/full-update.py
@@ -165,7 +165,7 @@ def main():
 
         master_disabled = not controller.enable_master()
         if master_disabled:
-            log.warn("Outage ongoing until pgbouncer bounced.")
+            log.warning("Outage ongoing until pgbouncer bounced.")
             return 96
         else:
             log.info("Outage complete. %s", datetime.now() - outage_start)
@@ -188,7 +188,7 @@ def main():
         if slaves_disabled:
             slaves_disabled = not controller.enable_slaves()
             if slaves_disabled:
-                log.warn(
+                log.warning(
                     "Failed to enable slave databases in pgbouncer. "
                     "Now running in master-only mode.")
 
diff --git a/database/schema/security.py b/database/schema/security.py
index 254ad94..bc5551d 100755
--- a/database/schema/security.py
+++ b/database/schema/security.py
@@ -541,7 +541,7 @@ def reset_permissions(con, config, options):
             if '.' not in obj_name:
                 continue
             if obj_name not in valid_objs:
-                log.warn('Bad object name %r', obj_name)
+                log.warning('Bad object name %r', obj_name)
                 continue
             obj = schema[obj_name]
 
@@ -659,7 +659,7 @@ def reset_permissions(con, config, options):
     forgotten = [obj.fullname for obj in forgotten
         if obj.type in ['table', 'function', 'view']]
     if forgotten:
-        log.warn('No permissions specified for %r', forgotten)
+        log.warning('No permissions specified for %r', forgotten)
 
     if options.dryrun:
         log.info("Dry run - rolling back changes")
diff --git a/lib/contrib/glock.py b/lib/contrib/glock.py
index fb835e2..2925be1 100644
--- a/lib/contrib/glock.py
+++ b/lib/contrib/glock.py
@@ -191,7 +191,7 @@ class GlobalLock:
                 raise LockAlreadyAcquired('Lock %s already acquired by '
                                           'someone else' % self.name)
             if self.previous_lockfile_present and self.logger:
-                self.logger.warn("Stale lockfile detected and claimed.")
+                self.logger.warning("Stale lockfile detected and claimed.")
             #print('got thread lock.') ##
 
         self.is_locked = True
diff --git a/lib/lp/archivepublisher/deathrow.py b/lib/lp/archivepublisher/deathrow.py
index af6e090..7570e96 100644
--- a/lib/lp/archivepublisher/deathrow.py
+++ b/lib/lp/archivepublisher/deathrow.py
@@ -290,7 +290,7 @@ class DeathRow:
                 # symlink has vanished from the pool/ (could be a code
                 # mistake) but there is nothing we can do about it at this
                 # point.
-                self.logger.warn(str(info))
+                self.logger.warning(str(info))
 
         self.logger.info("Total bytes freed: %s" % bytes)
 
diff --git a/lib/lp/archiveuploader/nascentuploadfile.py b/lib/lp/archiveuploader/nascentuploadfile.py
index 52b8b58..b5ece79 100644
--- a/lib/lp/archiveuploader/nascentuploadfile.py
+++ b/lib/lp/archiveuploader/nascentuploadfile.py
@@ -492,7 +492,7 @@ class BaseBinaryUploadFile(PackageUploadFile):
 
         if self.priority_name not in self.priority_map:
             default_priority = 'extra'
-            self.logger.warn(
+            self.logger.warning(
                  "Unable to grok priority %r, overriding it with %s"
                  % (self.priority_name, default_priority))
             self.priority_name = default_priority
diff --git a/lib/lp/archiveuploader/uploadprocessor.py b/lib/lp/archiveuploader/uploadprocessor.py
index 19e2e5d..2593673 100644
--- a/lib/lp/archiveuploader/uploadprocessor.py
+++ b/lib/lp/archiveuploader/uploadprocessor.py
@@ -197,7 +197,7 @@ class UploadProcessor:
                 try:
                     handler = UploadHandler.forProcessor(self, fsroot, upload)
                 except CannotGetBuild as e:
-                    self.log.warn(e)
+                    self.log.warning(e)
                 else:
                     handler.process()
         finally:
@@ -681,7 +681,7 @@ class BuildUploadHandler(UploadHandler):
             # bug, so get the upload out of the queue before the status
             # changes to something that might accidentally let it be
             # accepted.
-            self.processor.log.warn(
+            self.processor.log.warning(
                 "Expected build status to be UPLOADING or BUILDING, was %s.",
                 self.build.status.name)
             self.moveUpload(UploadStatusEnum.FAILED, logger)
diff --git a/lib/lp/buildmaster/manager.py b/lib/lp/buildmaster/manager.py
index dd2ae0f..1819b29 100644
--- a/lib/lp/buildmaster/manager.py
+++ b/lib/lp/buildmaster/manager.py
@@ -638,7 +638,7 @@ class SlaveScanner:
                 # The slave is either confused or disabled, so reset and
                 # requeue the job. The next scan cycle will clean up the
                 # slave if appropriate.
-                self.logger.warn(
+                self.logger.warning(
                     "%s. Resetting job %s.", lost_reason,
                     vitals.build_queue.build_cookie)
                 vitals.build_queue.reset()
diff --git a/lib/lp/registry/scripts/teamparticipation.py b/lib/lp/registry/scripts/teamparticipation.py
index 4bd9135..5484663 100644
--- a/lib/lp/registry/scripts/teamparticipation.py
+++ b/lib/lp/registry/scripts/teamparticipation.py
@@ -181,7 +181,7 @@ def check_teamparticipation_consistency(log, info):
 
     for error in errors:
         people_repr = ", ".join(imap(get_repr, error.people))
-        log.warn(
+        log.warning(
             "%s: %s TeamParticipation entries for %s.",
             get_repr(error.team), error.type, people_repr)
 
@@ -229,4 +229,4 @@ def fix_teamparticipation_consistency(log, errors):
             store.execute(statement)
             transaction.commit()
         else:
-            log.warn("Unrecognized error: %r", error)
+            log.warning("Unrecognized error: %r", error)
diff --git a/lib/lp/scripts/garbo.py b/lib/lp/scripts/garbo.py
index 6e0feac..637f7b4 100644
--- a/lib/lp/scripts/garbo.py
+++ b/lib/lp/scripts/garbo.py
@@ -1632,7 +1632,7 @@ class BaseDatabaseGarbageCollector(LaunchpadCronScript):
                 "Script aborted after %d seconds.", self.script_timeout)
 
         if tunable_loops:
-            self.logger.warn("%d tasks did not run.", len(tunable_loops))
+            self.logger.warning("%d tasks did not run.", len(tunable_loops))
 
         if self.failure_count:
             self.logger.error("%d tasks failed.", self.failure_count)
@@ -1736,7 +1736,7 @@ class BaseDatabaseGarbageCollector(LaunchpadCronScript):
                     tunable_loops.append(tunable_loop_class)
                 # Otherwise, emit a warning and skip the task.
                 else:
-                    loop_logger.warn(
+                    loop_logger.warning(
                         "Unable to acquire lock %s. Running elsewhere?",
                         loop_lock_path)
                 continue
diff --git a/lib/lp/scripts/utilities/killservice.py b/lib/lp/scripts/utilities/killservice.py
index a922052..a284ea8 100755
--- a/lib/lp/scripts/utilities/killservice.py
+++ b/lib/lp/scripts/utilities/killservice.py
@@ -68,7 +68,7 @@ def main():
     for service, pid in pids:
         if not process_exists(pid):
             continue
-        log.warn(
+        log.warning(
             "SIGTERM failed to kill %s (%d). Trying SIGKILL", service, pid)
         try:
             os.kill(pid, SIGKILL)
diff --git a/lib/lp/services/log/tests/test_logger.py b/lib/lp/services/log/tests/test_logger.py
index 2d80634..3b631e7 100644
--- a/lib/lp/services/log/tests/test_logger.py
+++ b/lib/lp/services/log/tests/test_logger.py
@@ -17,7 +17,7 @@ class TestBufferLogger(TestCase):
         # representing the contents of the logger's buffer.
         logger = BufferLogger()
         logger.info("Hello")
-        logger.warn("World")
+        logger.warning("World")
         self.assertEqual(
             "INFO Hello\nWARNING World\n",
             "".join(logger.content.iter_text()))
diff --git a/lib/lp/services/mail/incoming.py b/lib/lp/services/mail/incoming.py
index 4658ab6..6c29e20 100644
--- a/lib/lp/services/mail/incoming.py
+++ b/lib/lp/services/mail/incoming.py
@@ -367,7 +367,7 @@ def extract_addresses(mail, file_alias_url, log):
     else:
         # This most likely means a email configuration problem, and it should
         # log an oops.
-        log.warn(
+        log.warning(
             "No X-Launchpad-Original-To header was present "
             "in email: %s" % file_alias_url)
     # Process all addresses found as a fall back.
diff --git a/lib/lp/services/memcache/client.py b/lib/lp/services/memcache/client.py
index 2e54bd4..a3b5107 100644
--- a/lib/lp/services/memcache/client.py
+++ b/lib/lp/services/memcache/client.py
@@ -61,7 +61,7 @@ class TimelineRecordingClient(memcache.Client):
             if success:
                 logging.debug("Memcache set succeeded for %s", key)
             else:
-                logging.warn("Memcache set failed for %s", key)
+                logging.warning("Memcache set failed for %s", key)
             return success
         finally:
             action.finish()
diff --git a/lib/lp/services/scripts/tests/cronscript-crash.py b/lib/lp/services/scripts/tests/cronscript-crash.py
index 4a4823c..d882aa0 100755
--- a/lib/lp/services/scripts/tests/cronscript-crash.py
+++ b/lib/lp/services/scripts/tests/cronscript-crash.py
@@ -28,7 +28,7 @@ class CrashScript(LaunchpadCronScript):
         # Debug messages do not generate an OOPS.
         assert not self.oopses, "oops reported %r" % (self.oopses,)
 
-        self.logger.warn("This is a warning")
+        self.logger.warning("This is a warning")
         if len(self.oopses):
             self.logger.info("New OOPS detected")
         del self.oopses[:]
diff --git a/lib/lp/services/scripts/tests/loglevels.py b/lib/lp/services/scripts/tests/loglevels.py
index 5e760f6..947f434 100644
--- a/lib/lp/services/scripts/tests/loglevels.py
+++ b/lib/lp/services/scripts/tests/loglevels.py
@@ -38,7 +38,7 @@ if len(args) > 0:
 log = logger(options, 'loglevels')
 
 log.error("This is an error")
-log.warn("This is a warning")
+log.warning("This is a warning")
 log.info("This is info")
 log.debug("This is debug")
 log.debug2("This is debug2")
diff --git a/lib/lp/soyuz/scripts/gina/archive.py b/lib/lp/soyuz/scripts/gina/archive.py
index b289319..6ecb30a 100644
--- a/lib/lp/soyuz/scripts/gina/archive.py
+++ b/lib/lp/soyuz/scripts/gina/archive.py
@@ -153,9 +153,10 @@ class ArchiveComponentItems:
             archive_info = ArchiveFilesystemInfo(
                 archive_root, distroseries, component, arch, source_only)
         except NoBinaryArchive:
-            log.warn("The archive for %s/%s doesn't contain "
-                     "a directory for %s, skipping" %
-                     (distroseries, component, arch))
+            log.warning(
+                "The archive for %s/%s doesn't contain "
+                "a directory for %s, skipping" %
+                (distroseries, component, arch))
             return
         self._archive_archs.append(archive_info)
 
diff --git a/lib/lp/soyuz/scripts/gina/dominate.py b/lib/lp/soyuz/scripts/gina/dominate.py
index c3de55b..6b27a18 100644
--- a/lib/lp/soyuz/scripts/gina/dominate.py
+++ b/lib/lp/soyuz/scripts/gina/dominate.py
@@ -33,7 +33,7 @@ def dominate_imported_source_packages(txn, logger, distro_name, series_name,
         # file has a Published publication.  So there should be at least
         # as many Published publications as live versions.
         if pub_count < len(live_versions):
-            logger.warn(
+            logger.warning(
                 "Package %s has fewer live source publications (%s) than "
                 "live versions (%s).  The archive may be broken in some "
                 "way.",
diff --git a/lib/lp/soyuz/scripts/gina/handlers.py b/lib/lp/soyuz/scripts/gina/handlers.py
index 654b6e6..d3d4333 100644
--- a/lib/lp/soyuz/scripts/gina/handlers.py
+++ b/lib/lp/soyuz/scripts/gina/handlers.py
@@ -352,11 +352,12 @@ class ImporterHandler:
 
             # We couldn't find a sourcepackagerelease in the database.
             # Perhaps we can opportunistically pick one out of the archive.
-            log.warn("No source package %s (%s) listed for %s (%s), "
-                     "scrubbing archive..." %
-                     (binarypackagedata.source,
-                      version, binarypackagedata.package,
-                      binarypackagedata.version))
+            log.warning(
+                "No source package %s (%s) listed for %s (%s), "
+                "scrubbing archive..." %
+                (binarypackagedata.source,
+                 version, binarypackagedata.package,
+                 binarypackagedata.version))
 
             # XXX kiko 2005-11-03: I question whether
             # binarypackagedata.section here is actually correct -- but
@@ -369,8 +370,9 @@ class ImporterHandler:
             if sourcepackage:
                 return sourcepackage
 
-            log.warn("Nope, couldn't find it. Could it be a "
-                     "bin-only-NMU? Checking version %s" % version)
+            log.warning(
+                "Nope, couldn't find it. Could it be a "
+                "bin-only-NMU? Checking version %s" % version)
 
             # XXX kiko 2005-11-03: Testing a third cycle of this loop
             # isn't done.
diff --git a/lib/lp/soyuz/scripts/gina/packages.py b/lib/lp/soyuz/scripts/gina/packages.py
index 0143f7f..6f294d2 100644
--- a/lib/lp/soyuz/scripts/gina/packages.py
+++ b/lib/lp/soyuz/scripts/gina/packages.py
@@ -132,8 +132,8 @@ def read_dsc(package, version, component, distro_name, archive_root):
             with open(fullpath) as f:
                 changelog = f.read().strip()
         else:
-            log.warn("No changelog file found for %s in %s" %
-                     (package, source_dir))
+            log.warning(
+                "No changelog file found for %s in %s" % (package, source_dir))
             changelog = None
 
         copyright = None
@@ -145,7 +145,7 @@ def read_dsc(package, version, component, distro_name, archive_root):
                 copyright = f.read().strip()
 
         if copyright is None:
-            log.warn(
+            log.warning(
                 "No copyright file found for %s in %s" % (package, source_dir))
             copyright = ''
     finally:
@@ -365,7 +365,7 @@ class SourcePackageData(AbstractPackageData):
 
         if self.section is None:
             self.section = 'misc'
-            log.warn(
+            log.warning(
                 "Source package %s lacks section, assumed %r",
                 self.package, self.section)
 
@@ -399,28 +399,31 @@ class SourcePackageData(AbstractPackageData):
             cldata = parsed_changelog[0]
             if 'changes' in cldata:
                 if cldata["package"] != self.package:
-                    log.warn("Changelog package %s differs from %s" %
-                             (cldata["package"], self.package))
+                    log.warning(
+                        "Changelog package %s differs from %s" %
+                        (cldata["package"], self.package))
                 if cldata["version"] != self.version:
-                    log.warn("Changelog version %s differs from %s" %
-                             (cldata["version"], self.version))
+                    log.warning(
+                        "Changelog version %s differs from %s" %
+                        (cldata["version"], self.version))
                 self.changelog_entry = encoding.guess(cldata["changes"])
                 self.changelog = changelog
                 self.urgency = cldata["urgency"]
             else:
-                log.warn("Changelog empty for source %s (%s)" %
-                         (self.package, self.version))
+                log.warning(
+                    "Changelog empty for source %s (%s)" %
+                    (self.package, self.version))
 
     def ensure_complete(self):
         if self.format is None:
             # XXX kiko 2005-11-05: this is very funny. We care so much about
             # it here, but we don't do anything about this in handlers.py!
             self.format = "1.0"
-            log.warn(
+            log.warning(
                 "Invalid format in %s, assumed %r", self.package, self.format)
 
         if self.urgency not in ChangesFile.urgency_map:
-            log.warn(
+            log.warning(
                 "Invalid urgency in %s, %r, assumed %r",
                 self.package, self.urgency, "low")
             self.urgency = "low"
@@ -541,13 +544,13 @@ class BinaryPackageData(AbstractPackageData):
 
         if self.section is None:
             self.section = 'misc'
-            log.warn(
+            log.warning(
                 "Binary package %s lacks a section, assumed %r",
                 self.package, self.section)
 
         if self.priority is None:
             self.priority = 'extra'
-            log.warn(
+            log.warning(
                 "Binary package %s lacks valid priority, assumed %r",
                 self.package, self.priority)
 
diff --git a/lib/lp/soyuz/scripts/gina/runner.py b/lib/lp/soyuz/scripts/gina/runner.py
index 631323f..f5056c6 100644
--- a/lib/lp/soyuz/scripts/gina/runner.py
+++ b/lib/lp/soyuz/scripts/gina/runner.py
@@ -236,9 +236,9 @@ def import_binarypackages(distro, packages_map, package_root,
 
         if nosource:
             # XXX kiko 2005-10-23: untested
-            log.warn('%i source packages not found', len(nosource))
+            log.warning('%i source packages not found', len(nosource))
             for pkg in nosource:
-                log.warn(pkg)
+                log.warning(pkg)
 
 
 def do_one_binarypackage(distro, binary, archtag, package_root,
diff --git a/lib/lp/translations/model/potemplate.py b/lib/lp/translations/model/potemplate.py
index 0b05e25..e0f56c8 100644
--- a/lib/lp/translations/model/potemplate.py
+++ b/lib/lp/translations/model/potemplate.py
@@ -1001,7 +1001,7 @@ class POTemplate(SQLBase, RosettaStats):
                         txn.abort()
                         txn.begin()
                     if logger:
-                        logger.warn(
+                        logger.warning(
                             "Statistics update failed: %s" %
                             six.text_type(error))
 
@@ -1341,7 +1341,7 @@ class POTemplateSet:
             return matches[0]
         elif sourcepackagename is None:
             # Multiple matches, and for a product not a package.
-            logging.warn(
+            logging.warning(
                 "Found %d templates with path '%s' for productseries %s",
                 len(matches), path, productseries.title)
             return None
@@ -1358,7 +1358,7 @@ class POTemplateSet:
             if len(preferred_matches) == 1:
                 return preferred_matches[0]
             else:
-                logging.warn(
+                logging.warning(
                     "Found %d templates with path '%s' for package %s "
                     "(%d matched on from_sourcepackagename).",
                     len(matches), path, sourcepackagename.name,
diff --git a/lib/lp/translations/model/translationimportqueue.py b/lib/lp/translations/model/translationimportqueue.py
index f88ed94..2554ff5 100644
--- a/lib/lp/translations/model/translationimportqueue.py
+++ b/lib/lp/translations/model/translationimportqueue.py
@@ -615,7 +615,7 @@ class TranslationImportQueueEntry(StormBase):
                            "because entry %d is in the way." % (
                                potemplate.title, self.id, self.path,
                                existing_entry.id))
-                logging.warn(warning)
+                logging.warning(warning)
                 return None
 
             # We got the potemplate, try to guess the language from
diff --git a/lib/lp/translations/scripts/remove_translations.py b/lib/lp/translations/scripts/remove_translations.py
index 4b8040c..cfc3c31 100644
--- a/lib/lp/translations/scripts/remove_translations.py
+++ b/lib/lp/translations/scripts/remove_translations.py
@@ -288,7 +288,7 @@ class RemoveTranslations(LaunchpadScript):
         if not result:
             raise LaunchpadScriptFailure(message)
         if message is not None:
-            self.logger.warn(message)
+            self.logger.warning(message)
 
         if self.options.dry_run:
             self.logger.info("Dry run only.  Not really deleting.")
@@ -337,7 +337,7 @@ def warn_about_deleting_current_messages(cur, from_text, where_text, logger):
         cur.execute(query)
         rows = cur.fetchall()
         if cur.rowcount > 0:
-            logger.warn(
+            logger.warning(
                 'Deleting messages currently in use:')
             for (id, is_current_upstream, is_current_ubuntu) in rows:
                 current = []
@@ -345,7 +345,7 @@ def warn_about_deleting_current_messages(cur, from_text, where_text, logger):
                     current.append('upstream')
                 if is_current_ubuntu:
                     current.append('Ubuntu')
-                logger.warn(
+                logger.warning(
                     'Message %i is a current translation in %s'
                     % (id, ' and '.join(current)))
 
@@ -499,7 +499,7 @@ def remove_translations(logger=None, submitter=None, reviewer=None,
         if rows_deleted > 0:
             logger.info("Deleting %d message(s)." % rows_deleted)
         else:
-            logger.warn("No rows match; not deleting anything.")
+            logger.warning("No rows match; not deleting anything.")
 
     cur.execute("""
         UPDATE TranslationMessage
diff --git a/lib/lp/translations/scripts/reupload_translations.py b/lib/lp/translations/scripts/reupload_translations.py
index c53ff5c..c18db3e 100644
--- a/lib/lp/translations/scripts/reupload_translations.py
+++ b/lib/lp/translations/scripts/reupload_translations.py
@@ -113,6 +113,6 @@ class ReuploadPackageTranslations(LaunchpadScript):
                 filename_filter=_filter_ubuntu_translation_file)
 
         if not have_uploads:
-            self.logger.warn(
+            self.logger.warning(
                 "Found no translations upload for %s." % package.displayname)
             self.uploadless_packages.append(package)
diff --git a/lib/lp/translations/scripts/validate_translations_file.py b/lib/lp/translations/scripts/validate_translations_file.py
index e47df7f..84781e9 100644
--- a/lib/lp/translations/scripts/validate_translations_file.py
+++ b/lib/lp/translations/scripts/validate_translations_file.py
@@ -93,7 +93,7 @@ class ValidateTranslationsFile:
         except UnknownFileType:
             raise
         except Exception as e:
-            self.logger.warn("Failure in '%s': %s" % (filename, e))
+            self.logger.warning("Failure in '%s': %s" % (filename, e))
             return False
 
         return True
diff --git a/scripts/ftpmaster-tools/buildd-mass-retry.py b/scripts/ftpmaster-tools/buildd-mass-retry.py
index 30c2d2c..8e45425 100755
--- a/scripts/ftpmaster-tools/buildd-mass-retry.py
+++ b/scripts/ftpmaster-tools/buildd-mass-retry.py
@@ -121,7 +121,7 @@ class BuilddMassRetryScript(LaunchpadScript):
                     continue
 
                 if not build.can_be_retried:
-                    self.logger.warn(
+                    self.logger.warning(
                         'Can not retry %s (%s)' % (build.title, build.id))
                     continue
 
diff --git a/scripts/gina.py b/scripts/gina.py
index 4763f34..68ab92a 100755
--- a/scripts/gina.py
+++ b/scripts/gina.py
@@ -52,7 +52,7 @@ class Gina(LaunchpadCronScript):
         targets = [
             target.category_and_section_names[1] for target in sections]
         if len(targets) == 0:
-            self.logger.warn("No gina_target entries configured.")
+            self.logger.warning("No gina_target entries configured.")
         return targets
 
     def listTargets(self, targets):
diff --git a/scripts/update-stacked-on.py b/scripts/update-stacked-on.py
index 8485258..2d4bbaf 100755
--- a/scripts/update-stacked-on.py
+++ b/scripts/update-stacked-on.py
@@ -97,17 +97,17 @@ class UpdateStackedBranches(LaunchpadScript):
         try:
             bzrdir = BzrDir.open(bzr_branch_url)
         except errors.NotBranchError:
-            self.logger.warn(
+            self.logger.warning(
                 "No bzrdir for %r at %r" % (branch_id, bzr_branch_url))
             return
 
         try:
             current_stacked_on_location = get_branch_stacked_on_url(bzrdir)
         except errors.NotBranchError:
-            self.logger.warn(
+            self.logger.warning(
                 "No branch for %r at %r" % (branch_id, bzr_branch_url))
         except errors.NotStacked:
-            self.logger.warn(
+            self.logger.warning(
                 "Branch for %r at %r is not stacked at all. Giving up."
                 % (branch_id, bzr_branch_url))
         except UnstackableBranchFormat: