mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-15 18:16:13 +01:00
- keyring fix
This commit is contained in:
parent
32e99306b4
commit
74c73ee8a2
@ -117,6 +117,10 @@ class Osc(cmdln.Cmdln):
|
|||||||
config = {}
|
config = {}
|
||||||
config['user'] = raw_input('Username: ')
|
config['user'] = raw_input('Username: ')
|
||||||
config['pass'] = getpass.getpass()
|
config['pass'] = getpass.getpass()
|
||||||
|
if self.options.no_keyring:
|
||||||
|
config['use_keyring'] = '0'
|
||||||
|
if self.options.no_gnome_keyring:
|
||||||
|
config['gnome_keyring'] = '0'
|
||||||
if self.options.apiurl:
|
if self.options.apiurl:
|
||||||
config['apiurl'] = self.options.apiurl
|
config['apiurl'] = self.options.apiurl
|
||||||
|
|
||||||
|
@ -126,7 +126,8 @@ DEFAULTS = { 'apiurl': 'https://api.opensuse.org',
|
|||||||
config = DEFAULTS.copy()
|
config = DEFAULTS.copy()
|
||||||
|
|
||||||
boolean_opts = ['debug', 'do_package_tracking', 'http_debug', 'post_mortem', 'traceback', 'check_filelist', 'plaintext_passwd',
|
boolean_opts = ['debug', 'do_package_tracking', 'http_debug', 'post_mortem', 'traceback', 'check_filelist', 'plaintext_passwd',
|
||||||
'checkout_no_colon', 'check_for_request_on_action', 'linkcontrol', 'show_download_progress', 'request_show_interactive']
|
'checkout_no_colon', 'check_for_request_on_action', 'linkcontrol', 'show_download_progress', 'request_show_interactive',
|
||||||
|
'use_keyring', 'gnome_keyring']
|
||||||
|
|
||||||
new_conf_template = """
|
new_conf_template = """
|
||||||
[general]
|
[general]
|
||||||
@ -410,13 +411,14 @@ def write_initial_config(conffile, entries, custom_template = ''):
|
|||||||
config = DEFAULTS.copy()
|
config = DEFAULTS.copy()
|
||||||
config.update(entries)
|
config.update(entries)
|
||||||
config['passx'] = base64.b64encode(config['pass'].encode('bz2'))
|
config['passx'] = base64.b64encode(config['pass'].encode('bz2'))
|
||||||
if config['use_keyring'] and GENERIC_KEYRING:
|
# at this point use_keyring and gnome_keyring are str objects
|
||||||
|
if config['use_keyring'] == '1' and GENERIC_KEYRING:
|
||||||
protocol, host = \
|
protocol, host = \
|
||||||
parse_apisrv_url(None, config['apiurl'])
|
parse_apisrv_url(None, config['apiurl'])
|
||||||
keyring.set_password(host, config['user'], config['pass'])
|
keyring.set_password(host, config['user'], config['pass'])
|
||||||
config['pass'] = ''
|
config['pass'] = ''
|
||||||
config['passx'] = ''
|
config['passx'] = ''
|
||||||
elif config['gnome_keyring'] and GNOME_KEYRING:
|
elif config['gnome_keyring'] == '1' and GNOME_KEYRING:
|
||||||
protocol, host = \
|
protocol, host = \
|
||||||
parse_apisrv_url(None, config['apiurl'])
|
parse_apisrv_url(None, config['apiurl'])
|
||||||
gnomekeyring.set_network_password_sync(
|
gnomekeyring.set_network_password_sync(
|
||||||
|
Loading…
Reference in New Issue
Block a user