1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-24 17:16:12 +01:00

Merge pull request #1443 from dmach/fix-crash-when-missing-general-apiurl

Fix crash when there's no [general]/apiurl option in the config file
This commit is contained in:
Daniel Mach 2023-11-02 14:48:33 +01:00 committed by GitHub
commit 6a6d9cdc83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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'