mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-24 00:56:15 +01:00
- rewrite pass to passx if pass and passx mismatch
- do_config: automatically reread (which may lead to a rewrite) config if an option was changed
This commit is contained in:
parent
805d9f9bf7
commit
7ade282e6e
@ -6048,7 +6048,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
if not inp:
|
||||
raise oscerr.WrongArgs('error: no value was entered')
|
||||
val = [inp]
|
||||
opt, newval = conf.config_set_option(section, opt, ' '.join(val), delete=opts.delete, update=False)
|
||||
opt, newval = conf.config_set_option(section, opt, ' '.join(val), delete=opts.delete, update=True)
|
||||
if newval is None and opts.delete:
|
||||
print '\'%s\': \'%s\' got removed' % (section, opt)
|
||||
elif newval is None:
|
||||
@ -6057,6 +6057,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
if opts.no_echo:
|
||||
# supress value
|
||||
print '\'%s\': set \'%s\'' % (section, opt)
|
||||
elif opt == 'pass' and not conf.config['plaintext_passwd'] and newval == 'your_password':
|
||||
opt, newval = conf.config_set_option(section, 'passx')
|
||||
print '\'%s\': \'pass\' was rewritten to \'passx\': \'%s\'' % (section, newval)
|
||||
else:
|
||||
print '\'%s\': \'%s\' is set to \'%s\'' % (section, opt, newval)
|
||||
|
||||
|
@ -766,10 +766,13 @@ def get_config(override_conffile = None,
|
||||
except:
|
||||
print "%s: no credentials known" % url
|
||||
password = 'your_password'
|
||||
else:
|
||||
elif password != passwordx.decode('base64').decode('bz2'):
|
||||
if not passwordx:
|
||||
print "%s: rewriting from plain pass to encoded pass\n" % url
|
||||
add_section(conffile, url, user, password)
|
||||
# passx not present
|
||||
print '%s: rewriting from plain pass to encoded pass\n' % url
|
||||
else:
|
||||
print '%s: pass and passx mismatch (rewriting from plain pass to encoded pass)\n' % url
|
||||
add_section(conffile, url, user, password)
|
||||
|
||||
if cp.has_option(url, 'http_headers'):
|
||||
http_headers = cp.get(url, 'http_headers')
|
||||
|
Loading…
Reference in New Issue
Block a user