From 3683d9550d0da4000a7795f2fdc187ef77154641 Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Wed, 7 Sep 2011 15:19:54 +0200 Subject: [PATCH] - added "local_service_run" config option can be used to permanently disable the local service run on commit (default: enabled) --- osc/commandline.py | 12 +++++++----- osc/conf.py | 4 +++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index 005e17ed..e28ee54a 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -3718,7 +3718,9 @@ Please submit there instead, or use --nodevelproject to force direct submission. msg = open(opts.file).read() except: sys.exit('could not open file \'%s\'.' % opts.file) - + skip_local_service_run = False + if not conf.config['local_service_run'] or opts.skip_local_service_run: + skip_local_service_run = True arg_list = args[:] for arg in arg_list: if conf.config['do_package_tracking'] and is_project_dir(arg): @@ -3726,7 +3728,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. prj = Project(arg) if not msg: msg = edit_message() - prj.commit(msg=msg, skip_local_service_run=opts.skip_local_service_run, verbose=opts.verbose) + prj.commit(msg=msg, skip_local_service_run=skip_local_service_run, verbose=opts.verbose) except oscerr.ExtRuntimeError, e: print >>sys.stderr, "ERROR: service run failed", e return 1 @@ -3758,13 +3760,13 @@ Please submit there instead, or use --nodevelproject to force direct submission. prj = Project(prj_path) if not msg: msg = get_commit_msg(prj.absdir, pac_objs[prj_path]) - prj.commit(packages, msg=msg, files=files, skip_local_service_run=opts.skip_local_service_run, verbose=opts.verbose) + prj.commit(packages, msg=msg, files=files, skip_local_service_run=skip_local_service_run, verbose=opts.verbose) store_unlink_file(prj.absdir, '_commit_msg') for pac in single_paths: p = Package(pac) if not msg: msg = get_commit_msg(p.absdir, [p]) - p.commit(msg, skip_local_service_run=opts.skip_local_service_run, verbose=opts.verbose) + p.commit(msg, skip_local_service_run=skip_local_service_run, verbose=opts.verbose) store_unlink_file(p.absdir, '_commit_msg') else: for p in pacs: @@ -3774,7 +3776,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. p.todo.sort() if not msg: msg = get_commit_msg(p.absdir, [p]) - p.commit(msg, skip_local_service_run=opts.skip_local_service_run, verbose=opts.verbose) + p.commit(msg, skip_local_service_run=skip_local_service_run, verbose=opts.verbose) store_unlink_file(p.absdir, '_commit_msg') @cmdln.option('-r', '--revision', metavar='REV', diff --git a/osc/conf.py b/osc/conf.py index b93ae25b..3dd551db 100644 --- a/osc/conf.py +++ b/osc/conf.py @@ -145,6 +145,7 @@ DEFAULTS = {'apiurl': 'https://api.opensuse.org', 'submitrequest_declined_template': '', 'linkcontrol': '0', 'include_request_from_project': '1', + 'local_service_run': '1', # Maintenance defaults to OBS instance defaults 'maintained_attribute': 'OBS:Maintained', @@ -159,7 +160,8 @@ config = DEFAULTS.copy() boolean_opts = ['debug', 'do_package_tracking', 'http_debug', 'post_mortem', 'traceback', 'check_filelist', 'plaintext_passwd', 'checkout_no_colon', 'checkout_rooted', 'check_for_request_on_action', 'linkcontrol', 'show_download_progress', 'request_show_interactive', - 'use_keyring', 'gnome_keyring', 'no_verify', 'builtin_signature_check', 'http_full_debug', 'include_request_from_project'] + 'use_keyring', 'gnome_keyring', 'no_verify', 'builtin_signature_check', 'http_full_debug', 'include_request_from_project', + 'local_service_run'] api_host_options = ['user', 'pass', 'passx', 'aliases', 'http_headers', 'email', 'sslcertck', 'cafile', 'capath', 'trusted_prj']