mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-25 01:16:14 +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:
|
if not inp:
|
||||||
raise oscerr.WrongArgs('error: no value was entered')
|
raise oscerr.WrongArgs('error: no value was entered')
|
||||||
val = [inp]
|
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:
|
if newval is None and opts.delete:
|
||||||
print '\'%s\': \'%s\' got removed' % (section, opt)
|
print '\'%s\': \'%s\' got removed' % (section, opt)
|
||||||
elif newval is None:
|
elif newval is None:
|
||||||
@ -6057,6 +6057,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
if opts.no_echo:
|
if opts.no_echo:
|
||||||
# supress value
|
# supress value
|
||||||
print '\'%s\': set \'%s\'' % (section, opt)
|
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:
|
else:
|
||||||
print '\'%s\': \'%s\' is set to \'%s\'' % (section, opt, newval)
|
print '\'%s\': \'%s\' is set to \'%s\'' % (section, opt, newval)
|
||||||
|
|
||||||
|
@ -766,9 +766,12 @@ def get_config(override_conffile = None,
|
|||||||
except:
|
except:
|
||||||
print "%s: no credentials known" % url
|
print "%s: no credentials known" % url
|
||||||
password = 'your_password'
|
password = 'your_password'
|
||||||
else:
|
elif password != passwordx.decode('base64').decode('bz2'):
|
||||||
if not passwordx:
|
if not passwordx:
|
||||||
print "%s: rewriting from plain pass to encoded pass\n" % url
|
# 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)
|
add_section(conffile, url, user, password)
|
||||||
|
|
||||||
if cp.has_option(url, 'http_headers'):
|
if cp.has_option(url, 'http_headers'):
|
||||||
|
Loading…
Reference in New Issue
Block a user