mirror of
https://github.com/openSUSE/osc.git
synced 2025-10-05 17:09:19 +02:00
- cleaned up the conf module (I hope I didn't break anything):
* basically get rid of the scheme and apisrv mess - instead directly use the apiurl (== <protocol>://<host>) for everything * some other minor cleanups here and there * everyone who has a scheme or apisrv entry in his ~/.oscrc will get a deprecation warning but it's still working (at some point in the future we might remove these code paths) * when writing a new ~/.oscrc store the apiurl in the conffile [fixes #478054] - while being at it: * fixed #478054 ("osc asks for build.o.o credential even if -A<somelocalapi> is always used") * fixed #478052 ("osc backtrace on password entry (first startup)")
This commit is contained in:
@@ -53,7 +53,7 @@ class Osc(cmdln.Cmdln):
|
||||
help='debug HTTP traffic')
|
||||
optparser.add_option('-d', '--debug', action='store_true',
|
||||
help='print info useful for debugging')
|
||||
optparser.add_option('-A', '--apisrv', dest='apisrv',
|
||||
optparser.add_option('-A', '--apiurl', dest='apiurl',
|
||||
metavar='URL',
|
||||
help='specify URL to access API server at')
|
||||
optparser.add_option('-c', '--config', dest='conffile',
|
||||
@@ -66,7 +66,7 @@ class Osc(cmdln.Cmdln):
|
||||
"""merge commandline options into the config"""
|
||||
try:
|
||||
conf.get_config(override_conffile = self.options.conffile,
|
||||
override_apisrv = self.options.apisrv,
|
||||
override_apiurl = self.options.apiurl,
|
||||
override_debug = self.options.debug,
|
||||
override_http_debug = self.options.http_debug,
|
||||
override_traceback = self.options.traceback,
|
||||
@@ -78,6 +78,8 @@ class Osc(cmdln.Cmdln):
|
||||
config = {}
|
||||
config['user'] = raw_input('Username: ')
|
||||
config['pass'] = getpass.getpass()
|
||||
if self.options.apiurl:
|
||||
config['apiurl'] = self.options.apiurl
|
||||
|
||||
conf.write_initial_config(e.file, config)
|
||||
print >>sys.stderr, 'done'
|
||||
|
Reference in New Issue
Block a user