1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 09:16:16 +02: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:
Marcus Huewe 2010-11-14 13:08:26 +01:00
parent 805d9f9bf7
commit 7ade282e6e
2 changed files with 10 additions and 4 deletions

View File

@ -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)

View File

@ -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')