mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-08 20:15:47 +01:00
- made "osc rq <prj> <pkg>" output more precise, in case of no results
This commit is contained in:
parent
f7cfe4cdc8
commit
e435a84440
@ -2201,11 +2201,21 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
# Check if project actually exists if result list is empty
|
# Check if project actually exists if result list is empty
|
||||||
if not results:
|
if not results:
|
||||||
if project:
|
if project:
|
||||||
|
msg = 'No results for %(kind)s %(entity)s'
|
||||||
|
emsg = '%(kind)s %(entity)s does not exist'
|
||||||
|
d = {'entity': [project], 'kind': 'project'}
|
||||||
|
meth = show_project_meta
|
||||||
|
if package:
|
||||||
|
d['kind'] = 'package'
|
||||||
|
d['entity'].append(package)
|
||||||
|
meth = show_package_meta
|
||||||
try:
|
try:
|
||||||
show_project_meta(apiurl, project)
|
entity = d['entity']
|
||||||
print('No results for {0}'.format(project))
|
d['entity'] = '/'.join(entity)
|
||||||
|
meth(apiurl, *entity)
|
||||||
|
print(msg % d)
|
||||||
except HTTPError:
|
except HTTPError:
|
||||||
print('Project {0} does not exist'.format(project))
|
print(emsg % d)
|
||||||
else:
|
else:
|
||||||
print('No results')
|
print('No results')
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user