1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-24 22:06:14 +01:00

Fix several undefined-variable issues reported by pylint

This commit is contained in:
Daniel Mach 2022-07-28 21:01:16 +02:00
parent feb53212dd
commit eb83b42f32
2 changed files with 8 additions and 7 deletions

View File

@ -15,11 +15,12 @@ from xml.etree import ElementTree as ET
from . import conf
from . import connection
from . import core
from . import oscerr
from .conf import config
from .core import get_buildinfo, store_read_project, store_read_package, meta_exists, quote_plus, get_buildconfig, is_package_dir, dgst
from .core import get_binarylist, get_binary_file, run_external, return_external, raw_input
from .fetch import Fetcher, verify_pacs
from .fetch import Fetcher, OscFileGrabber, verify_pacs
from .meter import create_text_meter
from .util import rpmquery, debquery, archquery
from .util.helper import decode_it
@ -1078,7 +1079,7 @@ def main(apiurl, opts, argv):
http_debug = config['http_debug'],
modules = bi.modules,
enable_cpio=not opts.disable_cpio_bulk_download and bi.enable_cpio,
cookiejar=CookieJarAuthHandler(os.path.expanduser(conf.config["cookiejar"]))._cookiejar,
cookiejar=connection.CookieJarAuthHandler(os.path.expanduser(conf.config["cookiejar"]))._cookiejar,
download_api_only=opts.download_api_only)
if not opts.trust_all_projects:

View File

@ -856,11 +856,11 @@ class Osc(cmdln.Cmdln):
query['project'] = args[0]
query['package'] = args[1]
url = makeurl(apiurl, ['trigger', operation], query)
req = URLRequest(url)
req.get_method = lambda: "POST"
req.add_header('Content-Type', 'application/octet-stream')
req.add_header('Authorization', "Token "+opts.trigger)
fd = urlopen(req, data=None)
headers = {
'Content-Type': 'application/octet-stream',
'Authorization': "Token " + opts.trigger,
}
fd = http_POST(url, headers=headers)
print(decode_it(fd.read()))
else:
if args and args[0] in ['create', 'delete', 'trigger']: