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

do_vc: don't contact the api if the "email" config option is set

This commit is contained in:
Marcus Huewe 2016-09-23 16:37:23 +02:00
parent fdb773bbc9
commit b4d4d3c027

View File

@ -8263,26 +8263,24 @@ Please submit there instead, or use --nodevelproject to force direct submission.
print('Install the build package from http://download.opensuse.org/repositories/openSUSE:/Tools/', file=sys.stderr) print('Install the build package from http://download.opensuse.org/repositories/openSUSE:/Tools/', file=sys.stderr)
return 1 return 1
# set user's email if no mailaddr exists if args and is_package_dir(args[0]):
if 'mailaddr' not in os.environ:
if len(args) and is_package_dir(args[0]):
apiurl = store_read_apiurl(args[0]) apiurl = store_read_apiurl(args[0])
else: else:
apiurl = self.get_api_url() apiurl = self.get_api_url()
# set user's email if the mailaddr env variable is not set
if 'mailaddr' in os.environ:
pass
elif 'email' in conf.config['api_host_options'][apiurl]:
os.environ['mailaddr'] = conf.config['api_host_options'][apiurl]['email']
else:
user = conf.get_apiurl_usr(apiurl) user = conf.get_apiurl_usr(apiurl)
data = get_user_data(apiurl, user, 'email') data = get_user_data(apiurl, user, 'email')
if data: if data:
os.environ['mailaddr'] = data[0] os.environ['mailaddr'] = data[0]
else: else:
print('Try env mailaddr=...', file=sys.stderr) print('Try env mailaddr=...', file=sys.stderr)
# mailaddr can be overrided by config one
if 'email' in conf.config['api_host_options'][apiurl]:
os.environ['mailaddr'] = conf.config['api_host_options'][apiurl]['email']
if meego_style: if meego_style:
if opts.message or opts.just_edit: if opts.message or opts.just_edit:
print('Warning: to edit MeeGo style changelog, opts will be ignored.', file=sys.stderr) print('Warning: to edit MeeGo style changelog, opts will be ignored.', file=sys.stderr)