mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 14:56:14 +01:00
- minor changes/"cleanups"
This commit is contained in:
parent
59073eaff5
commit
73a2d30180
@ -716,7 +716,7 @@ class Osc(cmdln.Cmdln):
|
|||||||
raise oscerr.WrongArgs('Too many arguments.')
|
raise oscerr.WrongArgs('Too many arguments.')
|
||||||
|
|
||||||
if len(args) > 0 and len(args) <= 2 and is_project_dir(os.getcwd()):
|
if len(args) > 0 and len(args) <= 2 and is_project_dir(os.getcwd()):
|
||||||
sys.exit('osc submitrequest from project directory is only working without target specs and for source linked files\n')
|
sys.exit('osc submitrequest from project directory is only working without target specs and for source linked files\n')
|
||||||
|
|
||||||
apiurl = conf.config['apiurl']
|
apiurl = conf.config['apiurl']
|
||||||
|
|
||||||
@ -2525,22 +2525,20 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
|
|
||||||
for file in files:
|
for file in files:
|
||||||
if not opts.force:
|
if not opts.force:
|
||||||
resp = raw_input("rm: remove source file `%s' from `%s/%s'? " % (file, project, package))
|
resp = raw_input("rm: remove source file `%s' from `%s/%s'? (yY|nN) " % (file, project, package))
|
||||||
if resp not in ('y', 'Y'):
|
if resp not in ('y', 'Y'):
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
delete_files(conf.config['apiurl'], project, package, (file, ))
|
delete_files(conf.config['apiurl'], project, package, (file, ))
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
print >>sys.stderr, e.msg
|
|
||||||
|
|
||||||
if opts.force:
|
if opts.force:
|
||||||
|
print >>sys.stderr, e
|
||||||
body = e.read()
|
body = e.read()
|
||||||
if e.code in [ 400, 403, 404, 500 ]:
|
if e.code in [ 400, 403, 404, 500 ]:
|
||||||
if '<summary>' in body:
|
if '<summary>' in body:
|
||||||
msg = body.split('<summary>')[1]
|
msg = body.split('<summary>')[1]
|
||||||
msg = msg.split('</summary>')[0]
|
msg = msg.split('</summary>')[0]
|
||||||
print >>sys.stderr, msg
|
print >>sys.stderr, msg
|
||||||
continue
|
|
||||||
else:
|
else:
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user