]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: Update logger.warn() -> logger.warning()
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 9 May 2016 13:01:12 +0000 (14:01 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 9 May 2016 16:32:04 +0000 (17:32 +0100)
python deprecated logger.warn() in favour of logger.warning(). This is only
used in bitbake code so we may as well just translate everything to avoid
warnings under python 3. Its safe for python 2.7.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
21 files changed:
bin/bitbake-layers
bin/bitbake-worker
lib/bb/__init__.py
lib/bb/build.py
lib/bb/data.py
lib/bb/fetch2/__init__.py
lib/bb/fetch2/npm.py
lib/bb/monitordisk.py
lib/bb/parse/parse_py/ConfHandler.py
lib/bb/runqueue.py
lib/bb/siggen.py
lib/bb/ui/buildinfohelper.py
lib/bb/ui/knotty.py
lib/bb/ui/toasterui.py
lib/bb/utils.py
lib/toaster/bldcontrol/localhostbecontroller.py
lib/toaster/bldcontrol/management/commands/runbuilds.py
lib/toaster/bldcontrol/models.py
lib/toaster/contrib/tts/shellutils.py
lib/toaster/contrib/tts/urlcheck.py
lib/toaster/toastermain/urls.py

index d47a6690e6a763ed728fa1f77acbf6f7b607a435..8b17eb0696fd9bdf3b3ccf89200600c0bb684848 100755 (executable)
@@ -654,7 +654,7 @@ build results (as the layer priority order has effectively changed).
                                     logger.plain('  Skipping layer config file %s' % f1full )
                                     continue
                                 else:
-                                    logger.warn('Overwriting file %s', fdest)
+                                    logger.warning('Overwriting file %s', fdest)
                             bb.utils.copyfile(f1full, fdest)
                             if ext == '.bb':
                                 for append in self.bbhandler.cooker.collection.get_file_appends(f1full):
@@ -790,8 +790,8 @@ Lists recipes with the bbappends that apply to them as subitems.
 
             if best_filename:
                 if best_filename in missing:
-                    logger.warn('%s: missing append for preferred version',
-                                best_filename)
+                    logger.warning('%s: missing append for preferred version',
+                                   best_filename)
             return True
         else:
             return False
index 767a1c03367b48934b8087ea9fad83e99fd8b9cf..a4e8914eecb9835db379b9bc68013da7fc644fc1 100755 (executable)
@@ -364,7 +364,7 @@ class BitbakeWorker(object):
     def handle_ping(self, _):
         workerlog_write("Handling ping\n")
 
-        logger.warn("Pong from bitbake-worker!")
+        logger.warning("Pong from bitbake-worker!")
 
     def handle_quit(self, data):
         workerlog_write("Handling quit\n")
index 6c5e5ceaaa97b520c2f7ee892141a25e23e6aa66..4ae6b8a5f533817550813cf6c255811b974ad7e7 100644 (file)
@@ -85,7 +85,7 @@ def plain(*args):
 
 def debug(lvl, *args):
     if isinstance(lvl, basestring):
-        mainlogger.warn("Passed invalid debug level '%s' to bb.debug", lvl)
+        mainlogger.warning("Passed invalid debug level '%s' to bb.debug", lvl)
         args = (lvl,) + args
         lvl = 1
     mainlogger.debug(lvl, ''.join(args))
@@ -94,7 +94,7 @@ def note(*args):
     mainlogger.info(''.join(args))
 
 def warn(*args):
-    mainlogger.warn(''.join(args))
+    mainlogger.warning(''.join(args))
 
 def error(*args, **kwargs):
     mainlogger.error(''.join(args), extra=kwargs)
index a5b99edb7bc1783824be8df5ef39ecae670a3350..9854553038ef97b261635c6e5148c04db9c2f6d6 100644 (file)
@@ -172,7 +172,7 @@ def exec_func(func, d, dirs = None, pythonexception=False):
     body = d.getVar(func, False)
     if not body:
         if body is None:
-            logger.warn("Function %s doesn't exist", func)
+            logger.warning("Function %s doesn't exist", func)
         return
 
     flags = d.getVarFlags(func)
index b5dcdbd8f8e767b1e313f0a3ad9a5c0ede24570b..e9ce0ad4d09380b9aa2c86f082151d979f9f964b 100644 (file)
@@ -364,7 +364,7 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
             if varflags.get("python"):
                 parser = bb.codeparser.PythonParser(key, logger)
                 if value and "\t" in value:
-                    logger.warn("Variable %s contains tabs, please remove these (%s)" % (key, d.getVar("FILE", True)))
+                    logger.warning("Variable %s contains tabs, please remove these (%s)" % (key, d.getVar("FILE", True)))
                 parser.parse_python(value, filename=varflags.get("filename"), lineno=varflags.get("lineno"))
                 deps = deps | parser.references
                 deps = deps | (keys & parser.execs)
index 6ef0c6fe7a43f5590203de2146afb9b8fa84032e..600e2161fec4369cc475987e1899b0388884c1ef 100644 (file)
@@ -586,12 +586,12 @@ def verify_checksum(ud, d, precomputed={}):
             raise NoChecksumError('Missing SRC_URI checksum', ud.url)
 
         # Log missing sums so user can more easily add them
-        logger.warn('Missing md5 SRC_URI checksum for %s, consider adding to the recipe:\n'
-                    'SRC_URI[%s] = "%s"',
-                    ud.localpath, ud.md5_name, md5data)
-        logger.warn('Missing sha256 SRC_URI checksum for %s, consider adding to the recipe:\n'
-                    'SRC_URI[%s] = "%s"',
-                    ud.localpath, ud.sha256_name, sha256data)
+        logger.warning('Missing md5 SRC_URI checksum for %s, consider adding to the recipe:\n'
+                       'SRC_URI[%s] = "%s"',
+                       ud.localpath, ud.md5_name, md5data)
+        logger.warning('Missing sha256 SRC_URI checksum for %s, consider adding to the recipe:\n'
+                       'SRC_URI[%s] = "%s"',
+                       ud.localpath, ud.sha256_name, sha256data)
 
     # We want to alert the user if a checksum is defined in the recipe but
     # it does not match.
@@ -659,9 +659,9 @@ def verify_donestamp(ud, d, origud=None):
             # files to those containing the checksums.
             if not isinstance(e, EOFError):
                 # Ignore errors, they aren't fatal
-                logger.warn("Couldn't load checksums from donestamp %s: %s "
-                            "(msg: %s)" % (ud.donestamp, type(e).__name__,
-                                           str(e)))
+                logger.warning("Couldn't load checksums from donestamp %s: %s "
+                               "(msg: %s)" % (ud.donestamp, type(e).__name__,
+                                              str(e)))
 
     try:
         checksums = verify_checksum(ud, d, precomputed_checksums)
@@ -675,8 +675,8 @@ def verify_donestamp(ud, d, origud=None):
     except ChecksumError as e:
         # Checksums failed to verify, trigger re-download and remove the
         # incorrect stamp file.
-        logger.warn("Checksum mismatch for local file %s\n"
-                    "Cleaning and trying again." % ud.localpath)
+        logger.warning("Checksum mismatch for local file %s\n"
+                       "Cleaning and trying again." % ud.localpath)
         if os.path.exists(ud.localpath):
             rename_bad_checksum(ud, e.checksum)
         bb.utils.remove(ud.donestamp)
@@ -708,8 +708,8 @@ def update_stamp(ud, d):
         except ChecksumError as e:
             # Checksums failed to verify, trigger re-download and remove the
             # incorrect stamp file.
-            logger.warn("Checksum mismatch for local file %s\n"
-                        "Cleaning and trying again." % ud.localpath)
+            logger.warning("Checksum mismatch for local file %s\n"
+                           "Cleaning and trying again." % ud.localpath)
             if os.path.exists(ud.localpath):
                 rename_bad_checksum(ud, e.checksum)
             bb.utils.remove(ud.donestamp)
@@ -984,8 +984,8 @@ def try_mirror_url(fetch, origud, ud, ld, check = False):
 
     except bb.fetch2.BBFetchException as e:
         if isinstance(e, ChecksumError):
-            logger.warn("Mirror checksum failure for url %s (original url: %s)\nCleaning and trying again." % (ud.url, origud.url))
-            logger.warn(str(e))
+            logger.warning("Mirror checksum failure for url %s (original url: %s)\nCleaning and trying again." % (ud.url, origud.url))
+            logger.warning(str(e))
             if os.path.exists(ud.localpath):
                 rename_bad_checksum(ud, e.checksum)
         elif isinstance(e, NoChecksumError):
@@ -1200,7 +1200,7 @@ class FetchData(object):
             raise NonLocalMethod()
 
         if self.parm.get("proto", None) and "protocol" not in self.parm:
-            logger.warn('Consider updating %s recipe to use "protocol" not "proto" in SRC_URI.', d.getVar('PN', True))
+            logger.warning('Consider updating %s recipe to use "protocol" not "proto" in SRC_URI.', d.getVar('PN', True))
             self.parm["protocol"] = self.parm.get("proto", None)
 
         if hasattr(self.method, "urldata_init"):
@@ -1596,14 +1596,14 @@ class Fetch(object):
 
                     except BBFetchException as e:
                         if isinstance(e, ChecksumError):
-                            logger.warn("Checksum failure encountered with download of %s - will attempt other sources if available" % u)
+                            logger.warning("Checksum failure encountered with download of %s - will attempt other sources if available" % u)
                             logger.debug(1, str(e))
                             if os.path.exists(ud.localpath):
                                 rename_bad_checksum(ud, e.checksum)
                         elif isinstance(e, NoChecksumError):
                             raise
                         else:
-                            logger.warn('Failed to fetch URL %s, attempting MIRRORS if available' % u)
+                            logger.warning('Failed to fetch URL %s, attempting MIRRORS if available' % u)
                             logger.debug(1, str(e))
                         firsterr = e
                         # Remove any incomplete fetch
index e8d9b11099719a6f1ff3a3ca1bdeda81f268262f..d9e46b2e8c8fc03e4989b6e18978dda007911d69 100644 (file)
@@ -251,14 +251,14 @@ class Npm(FetchMethod):
             with open(shwrf) as datafile:
                 shrinkobj = json.load(datafile)
         except:
-            logger.warn('Missing shrinkwrap file in NPM_SHRINKWRAP for %s, this will lead to unreliable builds!' % ud.pkgname)
+            logger.warning('Missing shrinkwrap file in NPM_SHRINKWRAP for %s, this will lead to unreliable builds!' % ud.pkgname)
         lckdf = d.getVar('NPM_LOCKDOWN', True)
         logger.debug(2, "NPM lockdown file is %s" % lckdf)
         try:
             with open(lckdf) as datafile:
                 lockdown = json.load(datafile)
         except:
-            logger.warn('Missing lockdown file in NPM_LOCKDOWN for %s, this will lead to unreproducible builds!' % ud.pkgname)
+            logger.warning('Missing lockdown file in NPM_LOCKDOWN for %s, this will lead to unreproducible builds!' % ud.pkgname)
 
         if ('name' not in shrinkobj):
             self._getdependencies(ud.pkgname, jsondepobj, ud.version, d, ud)
index 466523c6e4cea746cbd9681e6e2cee0de7249754..203c40504469443216ce55aa78dab154e2f8e947 100644 (file)
@@ -220,7 +220,7 @@ class diskMonitor:
                 if minSpace and freeSpace < minSpace:
                     # Always show warning, the self.checked would always be False if the action is WARN
                     if self.preFreeS[k] == 0 or self.preFreeS[k] - freeSpace > self.spaceInterval and not self.checked[k]:
-                        logger.warn("The free space of %s (%s) is running low (%.3fGB left)" % \
+                        logger.warning("The free space of %s (%s) is running low (%.3fGB left)" % \
                                 (path, dev, freeSpace / 1024 / 1024 / 1024.0))
                         self.preFreeS[k] = freeSpace
 
@@ -246,7 +246,7 @@ class diskMonitor:
                         continue
                     # Always show warning, the self.checked would always be False if the action is WARN
                     if self.preFreeI[k] == 0 or self.preFreeI[k] - freeInode > self.inodeInterval and not self.checked[k]:
-                        logger.warn("The free inode of %s (%s) is running low (%.3fK left)" % \
+                        logger.warning("The free inode of %s (%s) is running low (%.3fK left)" % \
                                 (path, dev, freeInode / 1024.0))
                         self.preFreeI[k] = freeInode
 
index fbd75b14ad0653a1a96bdceff3a7e3c1e1b5be08..b9712929f3a0beecc57b90ddfeaeda38504bd359 100644 (file)
@@ -84,13 +84,13 @@ def include(parentfn, fn, lineno, data, error_out):
         bbpath = "%s:%s" % (dname, data.getVar("BBPATH", True))
         abs_fn, attempts = bb.utils.which(bbpath, fn, history=True)
         if abs_fn and bb.parse.check_dependency(data, abs_fn):
-            logger.warn("Duplicate inclusion for %s in %s" % (abs_fn, data.getVar('FILE', True)))
+            logger.warning("Duplicate inclusion for %s in %s" % (abs_fn, data.getVar('FILE', True)))
         for af in attempts:
             bb.parse.mark_dependency(data, af)
         if abs_fn:
             fn = abs_fn
     elif bb.parse.check_dependency(data, fn):
-        logger.warn("Duplicate inclusion for %s in %s" % (fn, data.getVar('FILE', True)))
+        logger.warning("Duplicate inclusion for %s in %s" % (fn, data.getVar('FILE', True)))
 
     try:
         bb.parse.handle(fn, data, True)
index e1b9b2e66180fa1a6b8456b5a8e671045a62ddb1..1c60d97c7feb95a5d719e205c9fe19bfd59c2df5 100644 (file)
@@ -824,7 +824,7 @@ class RunQueueData:
                     msg += "\n%s has unique rprovides:\n  %s" % (provfn, "\n  ".join(rprovide_results[provfn] - commonrprovs))
 
                 if self.warn_multi_bb:
-                    logger.warn(msg)
+                    logger.warning(msg)
                 else:
                     logger.error(msg)
 
@@ -852,7 +852,7 @@ class RunQueueData:
             taskdep = self.dataCache.task_deps[fn]
             fnid = self.taskData.getfn_id(fn)
             if taskname not in taskData.tasks_lookup[fnid]:
-                logger.warn("Task %s does not exist, invalidating this task will have no effect" % taskname)
+                logger.warning("Task %s does not exist, invalidating this task will have no effect" % taskname)
             if 'nostamp' in taskdep and taskname in taskdep['nostamp']:
                 if error_nostamp:
                     bb.fatal("Task %s is marked nostamp, cannot invalidate this task" % taskname)
index 88fc0f1d5ca2078d6dc9771ebbf293379e15efe3..21ecd8fbf578a50b190520a07d9cbbf5255391d9 100644 (file)
@@ -221,7 +221,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
         if taint:
             data = data + taint
             self.taints[k] = taint
-            logger.warn("%s is tainted from a forced run" % k)
+            logger.warning("%s is tainted from a forced run" % k)
 
         h = hashlib.md5(data).hexdigest()
         self.taskhash[k] = h
index 93979054d546e378b8144e5bbc8dc76b21de8ef2..ff4da78cdbcf751075c9cc6ebde09cdfe861b713 100644 (file)
@@ -664,8 +664,8 @@ class ORMWrapper(object):
                         dep_type = tdeptype,
                         target = target_obj))
                 except KeyError as e:
-                    logger.warn("Could not add dependency to the package %s "
-                                "because %s is an unknown package", p, px)
+                    logger.warning("Could not add dependency to the package %s "
+                                   "because %s is an unknown package", p, px)
 
         if len(packagedeps_objs) > 0:
             Package_Dependency.objects.bulk_create(packagedeps_objs)
@@ -673,7 +673,7 @@ class ORMWrapper(object):
             logger.info("No package dependencies created")
 
         if len(errormsg) > 0:
-            logger.warn("buildinfohelper: target_package_info could not identify recipes: \n%s", errormsg)
+            logger.warning("buildinfohelper: target_package_info could not identify recipes: \n%s", errormsg)
 
     def save_target_image_file_information(self, target_obj, file_name, file_size):
         Target_Image_File.objects.create( target = target_obj,
@@ -932,7 +932,7 @@ class BuildInfoHelper(object):
                 return lvo
 
         #if we get here, we didn't read layers correctly; dump whatever information we have on the error log
-        logger.warn("Could not match layer version for recipe path %s : %s", path, self.orm_wrapper.layer_version_objects)
+        logger.warning("Could not match layer version for recipe path %s : %s", path, self.orm_wrapper.layer_version_objects)
 
         #mockup the new layer
         unknown_layer, _ = Layer.objects.get_or_create(name="Unidentified layer", layer_index_url="")
@@ -1003,7 +1003,7 @@ class BuildInfoHelper(object):
                 self.internal_state['lvs'][self.orm_wrapper.get_update_layer_object(layerinfos[layer], self.brbe)] = layerinfos[layer]['version']
                 self.internal_state['lvs'][self.orm_wrapper.get_update_layer_object(layerinfos[layer], self.brbe)]['local_path'] = layerinfos[layer]['local_path']
             except NotExisting as nee:
-                logger.warn("buildinfohelper: cannot identify layer exception:%s ", nee)
+                logger.warning("buildinfohelper: cannot identify layer exception:%s ", nee)
 
 
     def store_started_build(self, event, build_log_path):
@@ -1240,14 +1240,14 @@ class BuildInfoHelper(object):
                     self.orm_wrapper.save_target_package_information(self.internal_state['build'], target, imgdata, pkgdata, self.internal_state['recipes'], built_package=True)
                     self.orm_wrapper.save_target_package_information(self.internal_state['build'], target, imgdata.copy(), pkgdata, self.internal_state['recipes'], built_package=False)
                 except KeyError as e:
-                    logger.warn("KeyError in save_target_package_information"
-                                "%s ", e)
+                    logger.warning("KeyError in save_target_package_information"
+                                   "%s ", e)
 
                 try:
                     self.orm_wrapper.save_target_file_information(self.internal_state['build'], target, filedata)
                 except KeyError as e:
-                    logger.warn("KeyError in save_target_file_information"
-                                "%s ", e)
+                    logger.warning("KeyError in save_target_file_information"
+                                   "%s ", e)
 
 
 
@@ -1392,7 +1392,7 @@ class BuildInfoHelper(object):
         Task_Dependency.objects.bulk_create(taskdeps_objects)
 
         if len(errormsg) > 0:
-            logger.warn("buildinfohelper: dependency info not identify recipes: \n%s", errormsg)
+            logger.warning("buildinfohelper: dependency info not identify recipes: \n%s", errormsg)
 
 
     def store_build_package_information(self, event):
index 268562770a21fee8a3d94159f9ef1e10697f56c3..903d72b56528c8d8ad0e6d05b3649b93b8554dd8 100644 (file)
@@ -350,7 +350,7 @@ def main(server, eventHandler, params, tf = TerminalFilter):
                         tries -= 1
                     if tries:
                         continue
-                logger.warn(event.msg)
+                logger.warning(event.msg)
                 continue
 
             if isinstance(event, logging.LogRecord):
@@ -377,7 +377,7 @@ def main(server, eventHandler, params, tf = TerminalFilter):
                 continue
 
             if isinstance(event, bb.build.TaskFailedSilent):
-                logger.warn("Logfile for failed setscene task is %s" % event.logfile)
+                logger.warning("Logfile for failed setscene task is %s" % event.logfile)
                 continue
             if isinstance(event, bb.build.TaskFailed):
                 return_value = 1
@@ -509,8 +509,8 @@ def main(server, eventHandler, params, tf = TerminalFilter):
                 continue
 
             if isinstance(event, bb.runqueue.sceneQueueTaskFailed):
-                logger.warn("Setscene task %s (%s) failed with exit code '%s' - real task will be run instead",
-                             event.taskid, event.taskstring, event.exitcode)
+                logger.warning("Setscene task %s (%s) failed with exit code '%s' - real task will be run instead",
+                               event.taskid, event.taskstring, event.exitcode)
                 continue
 
             if isinstance(event, bb.event.DepTreeGenerated):
index 6bf4c1f03001b63cd2be2e2f80beb285b371dd5e..addd5cc2faa2fc536008196c85568d26e32fe0bb 100644 (file)
@@ -163,7 +163,7 @@ def main(server, eventHandler, params):
     inheritlist, _ = server.runCommand(["getVariable", "INHERIT"])
 
     if not "buildhistory" in inheritlist.split(" "):
-        logger.warn("buildhistory is not enabled. Please enable INHERIT += \"buildhistory\" to see image details.")
+        logger.warning("buildhistory is not enabled. Please enable INHERIT += \"buildhistory\" to see image details.")
         build_history_enabled = False
 
     if not params.observe_only:
@@ -433,7 +433,7 @@ def main(server, eventHandler, params):
                 buildinfohelper.store_dependency_information(event)
                 continue
 
-            logger.warn("Unknown event: %s", event)
+            logger.warning("Unknown event: %s", event)
             return_value += 1
 
         except EnvironmentError as ioerror:
@@ -461,5 +461,5 @@ def main(server, eventHandler, params):
     if interrupted and return_value == 0:
         return_value += 1
 
-    logger.warn("Return value is %d", return_value)
+    logger.warning("Return value is %d", return_value)
     return return_value
index 5e735d3fa722bc72b74f0d13c4cf3bf7e70a47e0..2abf518eceb05b499a305c3c6d5e4402d2e0ccbe 100644 (file)
@@ -822,7 +822,7 @@ def copyfile(src, dest, newmtime = None, sstat = None):
         if not sstat:
             sstat = os.lstat(src)
     except Exception as e:
-        logger.warn("copyfile: stat of %s failed (%s)" % (src, e))
+        logger.warning("copyfile: stat of %s failed (%s)" % (src, e))
         return False
 
     destexists = 1
@@ -849,7 +849,7 @@ def copyfile(src, dest, newmtime = None, sstat = None):
             #os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
             return os.lstat(dest)
         except Exception as e:
-            logger.warn("copyfile: failed to create symlink %s to %s (%s)" % (dest, target, e))
+            logger.warning("copyfile: failed to create symlink %s to %s (%s)" % (dest, target, e))
             return False
 
     if stat.S_ISREG(sstat[stat.ST_MODE]):
@@ -864,7 +864,7 @@ def copyfile(src, dest, newmtime = None, sstat = None):
             shutil.copyfile(src, dest + "#new")
             os.rename(dest + "#new", dest)
         except Exception as e:
-            logger.warn("copyfile: copy %s to %s failed (%s)" % (src, dest, e))
+            logger.warning("copyfile: copy %s to %s failed (%s)" % (src, dest, e))
             return False
         finally:
             if srcchown:
@@ -875,13 +875,13 @@ def copyfile(src, dest, newmtime = None, sstat = None):
         #we don't yet handle special, so we need to fall back to /bin/mv
         a = getstatusoutput("/bin/cp -f " + "'" + src + "' '" + dest + "'")
         if a[0] != 0:
-            logger.warn("copyfile: failed to copy special file %s to %s (%s)" % (src, dest, a))
+            logger.warning("copyfile: failed to copy special file %s to %s (%s)" % (src, dest, a))
             return False # failure
     try:
         os.lchown(dest, sstat[stat.ST_UID], sstat[stat.ST_GID])
         os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown
     except Exception as e:
-        logger.warn("copyfile: failed to chown/chmod %s (%s)" % (dest, e))
+        logger.warning("copyfile: failed to chown/chmod %s (%s)" % (dest, e))
         return False
 
     if newmtime:
index 7def1f3a17225ffa8e56628db81b0479fc65ed01..7b2f126e9806ccdc3a05d5f88676349992aa8f06 100644 (file)
@@ -66,7 +66,7 @@ class LocalhostBEController(BuildEnvironmentController):
                 err = "command: %s \n%s" % (command, out)
             else:
                 err = "command: %s \n%s" % (command, err)
-            logger.warn("localhostbecontroller: shellcmd error %s" % err)
+            logger.warning("localhostbecontroller: shellcmd error %s" % err)
             raise ShellCmdException(err)
         else:
             logger.debug("localhostbecontroller: shellcmd success")
index 27289be5fd5a25db8280c289258a06fb79ee8100..5532b9deb2091b14937e27b51d089c547675680f 100644 (file)
@@ -164,16 +164,16 @@ class Command(NoArgsCommand):
             try:
                 self.cleanup()
             except Exception as e:
-                logger.warn("runbuilds: cleanup exception %s" % str(e))
+                logger.warning("runbuilds: cleanup exception %s" % str(e))
 
             try:
                 self.archive()
             except Exception as e:
-                logger.warn("runbuilds: archive exception %s" % str(e))
+                logger.warning("runbuilds: archive exception %s" % str(e))
 
             try:
                 self.schedule()
             except Exception as e:
-                logger.warn("runbuilds: schedule exception %s" % str(e))
+                logger.warning("runbuilds: schedule exception %s" % str(e))
 
             time.sleep(1)
index cb49a58c451ef2aba9d91fd8b020304c109ac61e..e09ad20dc3ef61fb4346e917ec3c85a20566ae32 100644 (file)
@@ -98,11 +98,11 @@ class BuildRequest(models.Model):
         # Check that the state we're trying to set is not going backwards
         # e.g. from REQ_FAILED to REQ_INPROGRESS
         if self.old_state != self.state and self.old_state > self.state:
-            logger.warn("Invalid state change requested: "
-                        "Cannot go from %s to %s - ignoring request" %
-                        (BuildRequest.REQUEST_STATE[self.old_state][1],
-                         BuildRequest.REQUEST_STATE[self.state][1])
-                       )
+            logger.warning("Invalid state change requested: "
+                           "Cannot go from %s to %s - ignoring request" %
+                           (BuildRequest.REQUEST_STATE[self.old_state][1],
+                            BuildRequest.REQUEST_STATE[self.state][1])
+                          )
             # Set property back to the old value
             self.state = self.old_state
             return
index c2012edf833d67c95a885fcaa18dac79d868f8db..ce64c0634006ed6a9764564d0cb3a2de931a5fd1 100644 (file)
@@ -133,7 +133,7 @@ def run_shell_cmd(command, cwd=None):
             err = "command: %s \n%s" % (command, out)
         else:
             err = "command: %s \n%s" % (command, err)
-        config.logger.warn("_shellcmd: error \n%s\n%s", out, err)
+        config.logger.warning("_shellcmd: error \n%s\n%s", out, err)
         raise ShellCmdException(err)
     else:
         #config.logger.debug("localhostbecontroller: shellcmd success\n%s" % out)
index 0820f82e2a0b41112c369492abe5232527461723..001fcee96a739fb0bf4a04d9f4ae9dfecbb16119 100644 (file)
@@ -26,12 +26,12 @@ def validate_html5(url):
             warnings = int(resp['x-w3c-validator-warnings'])
 
             if status == 'Invalid':
-                config.logger.warn("Failed %s is %s\terrors %s warnings %s (check at %s)", url, status, errors, warnings, urlrequest)
+                config.logger.warning("Failed %s is %s\terrors %s warnings %s (check at %s)", url, status, errors, warnings, urlrequest)
             else:
                 config.logger.debug("OK! %s", url)
 
     except Exception as exc:
-        config.logger.warn("Failed validation call: %s", exc)
+        config.logger.warning("Failed validation call: %s", exc)
     return (status, errors, warnings)
 
 
index 534679dc50049f4f3e1a0fbb71c553e17c7e615e..530a42ffabdd1b1449a4c5510d0f212cd478a515 100644 (file)
@@ -84,7 +84,7 @@ for t in os.walk(os.path.dirname(currentdir)):
         if not conflict:
             urlpatterns.insert(0, url(r'^' + modulename + '/', include ( modulename + '.urls')))
         else:
-            logger.warn("Module \'%s\' has a regexp conflict, was not added to the urlpatterns" % modulename)
+            logger.warning("Module \'%s\' has a regexp conflict, was not added to the urlpatterns" % modulename)
 
 from pprint import pformat
 #logger.debug("urlpatterns list %s", pformat(urlpatterns))