mirror of
https://git.yoctoproject.org/poky
synced 2026-04-20 11:28:58 +00:00
logging: use warning instead warn
The warn method is deprecated. We should use the documented warning instead.
Quoting from the python's official doc:
"""
Note: There is an obsolete method warn which is functionally identical to warning.
As warn is deprecated, please do not use it - use warning instead.
"""
(From OE-Core rev: f467fd277eb77336097cfc0f5f329bdc8d0f70cb)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -84,7 +84,7 @@ def export(args, config, basepath, workspace):
|
||||
|
||||
# if all workspace is excluded, quit
|
||||
if not len(set(workspace.keys()).difference(set(args.exclude))):
|
||||
logger.warn('All recipes in workspace excluded, nothing to export')
|
||||
logger.warning('All recipes in workspace excluded, nothing to export')
|
||||
return 0
|
||||
|
||||
exported = []
|
||||
|
||||
@@ -81,7 +81,7 @@ def devimport(args, config, basepath, workspace):
|
||||
break
|
||||
else:
|
||||
non_importables.append(fn)
|
||||
logger.warn('No recipe to append %s.bbapppend, skipping' % fn)
|
||||
logger.warning('No recipe to append %s.bbapppend, skipping' % fn)
|
||||
|
||||
# Extract
|
||||
imported = []
|
||||
@@ -104,9 +104,9 @@ def devimport(args, config, basepath, workspace):
|
||||
try:
|
||||
tar.extract(member, path=config.workspace_path)
|
||||
except PermissionError as pe:
|
||||
logger.warn(pe)
|
||||
logger.warning(pe)
|
||||
else:
|
||||
logger.warn('File already present. Use --overwrite/-o to overwrite it: %s' % member.name)
|
||||
logger.warning('File already present. Use --overwrite/-o to overwrite it: %s' % member.name)
|
||||
continue
|
||||
else:
|
||||
tar.extract(member, path=config.workspace_path)
|
||||
@@ -129,7 +129,7 @@ def devimport(args, config, basepath, workspace):
|
||||
if imported:
|
||||
logger.info('Imported recipes into workspace %s: %s' % (config.workspace_path, ', '.join(imported)))
|
||||
else:
|
||||
logger.warn('No recipes imported into the workspace')
|
||||
logger.warning('No recipes imported into the workspace')
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ def add(args, config, basepath, workspace):
|
||||
args.srctree = args.recipename
|
||||
args.recipename = None
|
||||
elif os.path.isdir(args.recipename):
|
||||
logger.warn('Ambiguous argument "%s" - assuming you mean it to be the recipe name' % args.recipename)
|
||||
logger.warning('Ambiguous argument "%s" - assuming you mean it to be the recipe name' % args.recipename)
|
||||
|
||||
if not args.fetchuri:
|
||||
if args.srcrev:
|
||||
@@ -82,7 +82,7 @@ def add(args, config, basepath, workspace):
|
||||
if args.fetchuri:
|
||||
raise DevtoolError('URI specified as positional argument as well as -f/--fetch')
|
||||
else:
|
||||
logger.warn('-f/--fetch option is deprecated - you can now simply specify the URL to fetch as a positional argument instead')
|
||||
logger.warning('-f/--fetch option is deprecated - you can now simply specify the URL to fetch as a positional argument instead')
|
||||
args.fetchuri = args.fetch
|
||||
|
||||
if args.recipename:
|
||||
@@ -217,7 +217,7 @@ def add(args, config, basepath, workspace):
|
||||
raise DevtoolError('Command \'%s\' did not create any recipe file:\n%s' % (e.command, e.stdout))
|
||||
attic_recipe = os.path.join(config.workspace_path, 'attic', recipename, os.path.basename(recipefile))
|
||||
if os.path.exists(attic_recipe):
|
||||
logger.warn('A modified recipe from a previous invocation exists in %s - you may wish to move this over the top of the new recipe if you had changes in it that you want to continue with' % attic_recipe)
|
||||
logger.warning('A modified recipe from a previous invocation exists in %s - you may wish to move this over the top of the new recipe if you had changes in it that you want to continue with' % attic_recipe)
|
||||
finally:
|
||||
if tmpsrcdir and os.path.exists(tmpsrcdir):
|
||||
shutil.rmtree(tmpsrcdir)
|
||||
@@ -295,7 +295,7 @@ def add(args, config, basepath, workspace):
|
||||
with open(layerconf_file, 'a') as f:
|
||||
f.write('%s = "%s"\n' % (preferred_provider, recipe_name))
|
||||
else:
|
||||
logger.warn('Set \'%s\' in order to use the recipe' % preferred_provider)
|
||||
logger.warning('Set \'%s\' in order to use the recipe' % preferred_provider)
|
||||
break
|
||||
|
||||
_add_md5(config, recipename, appendfile)
|
||||
@@ -704,7 +704,7 @@ def _check_preserve(config, recipename):
|
||||
if splitline[2] != md5:
|
||||
bb.utils.mkdirhier(preservepath)
|
||||
preservefile = os.path.basename(removefile)
|
||||
logger.warn('File %s modified since it was written, preserving in %s' % (preservefile, preservepath))
|
||||
logger.warning('File %s modified since it was written, preserving in %s' % (preservefile, preservepath))
|
||||
shutil.move(removefile, os.path.join(preservepath, preservefile))
|
||||
else:
|
||||
os.remove(removefile)
|
||||
@@ -795,7 +795,7 @@ def modify(args, config, basepath, workspace):
|
||||
if branchname.startswith(override_branch_prefix):
|
||||
branches.append(branchname)
|
||||
if branches:
|
||||
logger.warn('SRC_URI is conditionally overridden in this recipe, thus several %s* branches have been created, one for each override that makes changes to SRC_URI. It is recommended that you make changes to the %s branch first, then checkout and rebase each %s* branch and update any unique patches there (duplicates on those branches will be ignored by devtool finish/update-recipe)' % (override_branch_prefix, args.branch, override_branch_prefix))
|
||||
logger.warning('SRC_URI is conditionally overridden in this recipe, thus several %s* branches have been created, one for each override that makes changes to SRC_URI. It is recommended that you make changes to the %s branch first, then checkout and rebase each %s* branch and update any unique patches there (duplicates on those branches will be ignored by devtool finish/update-recipe)' % (override_branch_prefix, args.branch, override_branch_prefix))
|
||||
branches.insert(0, args.branch)
|
||||
seen_patches = []
|
||||
for branch in branches:
|
||||
@@ -1720,7 +1720,7 @@ def update_recipe(args, config, basepath, workspace):
|
||||
if updated:
|
||||
rf = rd.getVar('FILE')
|
||||
if rf.startswith(config.workspace_path):
|
||||
logger.warn('Recipe file %s has been updated but is inside the workspace - you will need to move it (and any associated files next to it) out to the desired layer before using "devtool reset" in order to keep any changes' % rf)
|
||||
logger.warning('Recipe file %s has been updated but is inside the workspace - you will need to move it (and any associated files next to it) out to the desired layer before using "devtool reset" in order to keep any changes' % rf)
|
||||
finally:
|
||||
tinfoil.shutdown()
|
||||
|
||||
@@ -1803,7 +1803,7 @@ def _reset(recipes, no_clean, config, basepath, workspace):
|
||||
if os.path.exists(origdir):
|
||||
for root, dirs, files in os.walk(origdir):
|
||||
for fn in files:
|
||||
logger.warn('Preserving %s in %s' % (fn, preservepath))
|
||||
logger.warning('Preserving %s in %s' % (fn, preservepath))
|
||||
_move_file(os.path.join(origdir, fn),
|
||||
os.path.join(preservepath, fn))
|
||||
for dn in dirs:
|
||||
|
||||
@@ -264,7 +264,7 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee
|
||||
if no_patch:
|
||||
patches = oe.recipeutils.get_recipe_patches(crd)
|
||||
if patches:
|
||||
logger.warn('By user choice, the following patches will NOT be applied to the new source tree:\n %s' % '\n '.join([os.path.basename(patch) for patch in patches]))
|
||||
logger.warning('By user choice, the following patches will NOT be applied to the new source tree:\n %s' % '\n '.join([os.path.basename(patch) for patch in patches]))
|
||||
else:
|
||||
__run('git checkout devtool-patched -b %s' % branch)
|
||||
skiptag = False
|
||||
@@ -273,9 +273,9 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee
|
||||
except bb.process.ExecutionError as e:
|
||||
skiptag = True
|
||||
if 'conflict' in e.stdout:
|
||||
logger.warn('Command \'%s\' failed:\n%s\n\nYou will need to resolve conflicts in order to complete the upgrade.' % (e.command, e.stdout.rstrip()))
|
||||
logger.warning('Command \'%s\' failed:\n%s\n\nYou will need to resolve conflicts in order to complete the upgrade.' % (e.command, e.stdout.rstrip()))
|
||||
else:
|
||||
logger.warn('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
|
||||
logger.warning('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
|
||||
if not skiptag:
|
||||
if uri.startswith('git://'):
|
||||
suffix = 'new'
|
||||
|
||||
Reference in New Issue
Block a user