diff --git a/osc/commandline.py b/osc/commandline.py index 8ecd7278..c5d9145e 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -3221,6 +3221,9 @@ Please submit there instead, or use --nodevelproject to force direct submission. reqid = None supersedid = None + incident = None + priority = None + if cmd == 'list' or cmd == 'approvenew': package = None project = None @@ -3259,6 +3262,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. # approve request elif cmd == 'approve' or cmd == 'cancelapproval': + assert reqid is not None query = {'cmd': cmd} url = makeurl(apiurl, ['request', reqid], query) r = http_POST(url, data=opts.message) @@ -3266,6 +3270,8 @@ Please submit there instead, or use --nodevelproject to force direct submission. # change incidents elif cmd == 'setincident': + assert reqid is not None + assert incident is not None query = {'cmd': 'setincident', 'incident': incident} url = makeurl(apiurl, ['request', reqid], query) r = http_POST(url, data=opts.message) @@ -3273,6 +3279,8 @@ Please submit there instead, or use --nodevelproject to force direct submission. # change priority elif cmd in ['prioritize', 'priorize']: + assert reqid is not None + assert priority is not None query = {'cmd': 'setpriority', 'priority': priority} url = makeurl(apiurl, ['request', reqid], query) r = http_POST(url, data=opts.message) @@ -3372,12 +3380,11 @@ Please submit there instead, or use --nodevelproject to force direct submission. # FIXME: date filtering should become implemented on server side - if opts.target_package_filter: - filter_pattern = re.compile(opts.target_package_filter) + filter_pattern = re.compile(opts.target_package_filter) if opts.target_package_filter else None for result in results: filtered = False for action in result.actions: - if action.type == 'group' or not opts.target_package_filter: + if action.type == "group" or not filter_pattern: continue if action.tgt_package is not None and not filter_pattern.match(action.tgt_package): filtered = True @@ -6677,6 +6684,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. wd = Path.cwd() doprint = False + msg = "" if is_package_dir(wd): msg = 'Valid arguments for this package are:' doprint = True diff --git a/osc/conf.py b/osc/conf.py index 40d825d8..652d5f81 100644 --- a/osc/conf.py +++ b/osc/conf.py @@ -74,7 +74,7 @@ from .util.models import * GENERIC_KEYRING = False try: - import keyring + import keyring # pylint: disable=import-error GENERIC_KEYRING = True except: pass diff --git a/osc/core.py b/osc/core.py index 91bf1d37..cf484272 100644 --- a/osc/core.py +++ b/osc/core.py @@ -2043,6 +2043,7 @@ def edit_text(data='', delim=None, suffix='.txt', template=''): mtime = os.stat(filename).st_mtime ri_err = False while True: + file_changed = False if not ri_err: file_changed = _edit_message_open_editor(filename, data, mtime) msg = open(filename).read()