1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-27 18:26:15 +01:00

- keyring fix

This commit is contained in:
Marcus Huewe 2010-02-25 14:13:02 +01:00
parent 32e99306b4
commit 74c73ee8a2
2 changed files with 9 additions and 3 deletions

View File

@ -117,6 +117,10 @@ class Osc(cmdln.Cmdln):
config = {}
config['user'] = raw_input('Username: ')
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:
config['apiurl'] = self.options.apiurl

View File

@ -126,7 +126,8 @@ DEFAULTS = { 'apiurl': 'https://api.opensuse.org',
config = DEFAULTS.copy()
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 = """
[general]
@ -410,13 +411,14 @@ def write_initial_config(conffile, entries, custom_template = ''):
config = DEFAULTS.copy()
config.update(entries)
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 = \
parse_apisrv_url(None, config['apiurl'])
keyring.set_password(host, config['user'], config['pass'])
config['pass'] = ''
config['passx'] = ''
elif config['gnome_keyring'] and GNOME_KEYRING:
elif config['gnome_keyring'] == '1' and GNOME_KEYRING:
protocol, host = \
parse_apisrv_url(None, config['apiurl'])
gnomekeyring.set_network_password_sync(