diff --git a/osc/build.py b/osc/build.py index 01537811..5160ebda 100644 --- a/osc/build.py +++ b/osc/build.py @@ -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: diff --git a/osc/commandline.py b/osc/commandline.py index 02f782c4..278910be 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -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']: