koji: small patch to fix warnings

After the koji.conf 'pkgurl' attribute was enabled (sigul wants this;
I'll submit a patch for that too, later), one of my scripts broke
because the "Warning: the pkgurl option is obsolete" message is printed
to stdout instead of stderr.  Here's a little patch to print the warning
with the warn() function instead.

I realize some warnings from the cli might be best printed to stdout,
but for ones that might appear when using a computer-readable type of
command like 'list-* --quiet', stderr seems like the better choice.

Thanks-

	John
This commit is contained in:
John Morris 2012-04-04 12:16:42 -05:00 committed by Mike McLean
parent c902546866
commit 38f7d2529f

View file

@ -234,14 +234,15 @@ def get_options():
#pkgurl is obsolete
if options.pkgurl:
if options.topurl:
print "Warning: the pkgurl option is obsolete"
warn("Warning: the pkgurl option is obsolete")
else:
suggest = re.sub(r'/packages/?$', '', options.pkgurl)
if suggest != options.pkgurl:
print "Warning: the pkgurl option is obsolete, using topurl=%r" % suggest
warn("Warning: the pkgurl option is obsolete, using topurl=%r"
% suggest)
options.topurl = suggest
else:
print "Warning: The pkgurl option is obsolete, please use topurl instead"
warn("Warning: The pkgurl option is obsolete, please use topurl instead")
return options, cmd, args[1:]