Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: [gentoo-portage-dev] [PATCH] Fix deprecated logging.warn() calls (bug 549322)
Date: Wed, 13 May 2015 02:28:04
Message-Id: 1431484044-5972-1-git-send-email-zmedico@gentoo.org
1 X-Gentoo-Bug: 549322
2 X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=549322
3 ---
4 bin/repoman | 10 +++++-----
5 pym/portage/_emirrordist/Config.py | 6 +++---
6 pym/portage/_emirrordist/MirrorDistTask.py | 4 ++--
7 pym/repoman/utilities.py | 8 ++++----
8 4 files changed, 14 insertions(+), 14 deletions(-)
9
10 diff --git a/bin/repoman b/bin/repoman
11 index 4763b39..b193ce5 100755
12 --- a/bin/repoman
13 +++ b/bin/repoman
14 @@ -282,10 +282,10 @@ def ParseArgs(argv, qahelp):
15 if opts.mode == 'commit' and not (opts.force or opts.pretend):
16 if opts.ignore_masked:
17 opts.ignore_masked = False
18 - logging.warn('Commit mode automatically disables --ignore-masked')
19 + logging.warning('Commit mode automatically disables --ignore-masked')
20 if opts.without_mask:
21 opts.without_mask = False
22 - logging.warn('Commit mode automatically disables --without-mask')
23 + logging.warning('Commit mode automatically disables --without-mask')
24
25 return (opts, args)
26
27 @@ -435,7 +435,7 @@ commitmessage = None
28 for x in missingvars:
29 x += ".missing"
30 if x not in qacats:
31 - logging.warn('* missingvars values need to be added to qahelp ("%s")' % x)
32 + logging.warning('* missingvars values need to be added to qahelp ("%s")' % x)
33 qacats.append(x)
34 qawarnings.add(x)
35
36 @@ -647,7 +647,7 @@ if repo_config.sign_manifest and repo_config.name == "gentoo" and \
37 "'sign-manifests = false' in metadata/layout.conf.") % \
38 (repo_config.name,)
39 for line in textwrap.wrap(msg, 60):
40 - logging.warn(line)
41 + logging.warning(line)
42
43 if sign_manifests and options.mode in ("commit",) and \
44 repoman_settings.get("PORTAGE_GPG_KEY") and \
45 @@ -2424,7 +2424,7 @@ for x in effective_scanlist:
46 (x, myflag))
47
48 if options.if_modified == "y" and len(effective_scanlist) < 1:
49 - logging.warn("--if-modified is enabled, but no modified packages were found!")
50 + logging.warning("--if-modified is enabled, but no modified packages were found!")
51
52 if options.mode == "manifest":
53 sys.exit(dofail)
54 diff --git a/pym/portage/_emirrordist/Config.py b/pym/portage/_emirrordist/Config.py
55 index db4bfeb..f884a49 100644
56 --- a/pym/portage/_emirrordist/Config.py
57 +++ b/pym/portage/_emirrordist/Config.py
58 @@ -79,8 +79,8 @@ class Config(object):
59 line_format = "%s: %%s" % log_desc
60 add_newline = False
61 if log_path is not None:
62 - logging.warn(("dry-run: %s log "
63 - "redirected to logging.info") % log_desc)
64 + logging.warning("dry-run: %s log "
65 + "redirected to logging.info" % log_desc)
66 else:
67 self._open_files.append(io.open(log_path, mode=mode,
68 encoding='utf_8'))
69 @@ -114,7 +114,7 @@ class Config(object):
70 db = ShelveUnicodeWrapper(db)
71
72 if self.options.dry_run:
73 - logging.warn("dry-run: %s db opened in readonly mode" % db_desc)
74 + logging.warning("dry-run: %s db opened in readonly mode" % db_desc)
75 if not isinstance(db, dict):
76 volatile_db = dict((k, db[k]) for k in db)
77 db.close()
78 diff --git a/pym/portage/_emirrordist/MirrorDistTask.py b/pym/portage/_emirrordist/MirrorDistTask.py
79 index 571caa5..e23a11b 100644
80 --- a/pym/portage/_emirrordist/MirrorDistTask.py
81 +++ b/pym/portage/_emirrordist/MirrorDistTask.py
82 @@ -166,8 +166,8 @@ class MirrorDistTask(CompositeTask):
83 date_files.append(filename)
84
85 if dry_run:
86 - logging.warn(("dry-run: scheduled-deletions log "
87 - "will be summarized via logging.info"))
88 + logging.warning("dry-run: scheduled-deletions log "
89 + "will be summarized via logging.info")
90
91 lines = []
92 for date in sorted(date_map):
93 diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
94 index a2535f0..b9594a7 100644
95 --- a/pym/repoman/utilities.py
96 +++ b/pym/repoman/utilities.py
97 @@ -276,16 +276,16 @@ def FindPackagesToScan(settings, startdir, reposplit):
98 # we only want 1 segment of the directory, is why we use catdir instead of startdir
99 catdir = reposplit[-2]
100 if catdir not in settings.categories:
101 - logging.warn('%s is not a valid category according to profiles/categories, ' \
102 - 'skipping checks in %s' % (catdir, catdir))
103 + logging.warning('%s is not a valid category according to '
104 + 'profiles/categories, skipping checks in %s' % (catdir, catdir))
105 else:
106 scanlist = AddPackagesInDir(catdir)
107 elif repolevel == 3: # pkgdir level, startdir = pkgdir
108 catdir = reposplit[-2]
109 pkgdir = reposplit[-1]
110 if catdir not in settings.categories:
111 - logging.warn('%s is not a valid category according to profiles/categories, ' \
112 - 'skipping checks in %s' % (catdir, catdir))
113 + logging.warning('%s is not a valid category according to '
114 + 'profiles/categories, skipping checks in %s' % (catdir, catdir))
115 else:
116 path = os.path.join(catdir, pkgdir)
117 logging.debug('adding %s to scanlist' % path)
118 --
119 2.3.5