From 15db3a092f09ab049702dc51c2f49e25d00b2ad0 Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Thu, 2 Nov 2023 13:44:46 +0100 Subject: [PATCH] Fix crash when there's no [general]/apiurl option in the config file --- osc/commandline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index e7dd60c0..f406769e 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -4280,7 +4280,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. return apiopt = '' - if conf.get_configParser().get('general', 'apiurl') != apiurl: + if conf.get_configParser().get("general", "apiurl", fallback=None) != apiurl: apiopt = '-A %s ' % apiurl print('A working copy of the maintenance branch can be checked out with:\n\n' 'osc %sco %s' @@ -4451,7 +4451,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. _private.print_msg('Note: You can use "osc delete" or "osc submitpac" when done.\n', print_to="verbose") else: apiopt = '' - if conf.get_configParser().get('general', 'apiurl') != apiurl: + if conf.get_configParser().get("general", "apiurl", fallback=None) != apiurl: apiopt = '-A %s ' % apiurl print('A working copy of the branched package can be checked out with:\n\n' 'osc %sco %s/%s'