mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-04 10:36:17 +01:00
use more generic oscerr.PackageNotInstalled
This commit is contained in:
parent
b0ddeb909d
commit
b33577b6a7
@ -158,7 +158,7 @@ def run(prg):
|
||||
print >>sys.stderr, e.msg
|
||||
return 1
|
||||
|
||||
except oscerr.ServiceNotInstalled, e:
|
||||
except oscerr.PackageNotInstalled, e:
|
||||
print >>sys.stderr, e.msg
|
||||
return 1
|
||||
|
||||
@ -207,4 +207,8 @@ def run(prg):
|
||||
print >>sys.stderr, e
|
||||
return 1
|
||||
|
||||
except oscerr.OscBaseError, e:
|
||||
print >>sys.stderr, '*** Error:', e
|
||||
return 1
|
||||
|
||||
# vim: sw=4 et
|
||||
|
@ -328,9 +328,7 @@ class Serviceinfo:
|
||||
temp_dir = tempfile.mkdtemp()
|
||||
name = call.split(None, 1)[0]
|
||||
if not os.path.exists("/usr/lib/obs/service/"+name):
|
||||
msg = "ERROR: service is not installed!\n"
|
||||
msg += "Maybe try this: zypper in obs-service-" + name
|
||||
raise oscerr.ServiceNotInstalled(msg)
|
||||
raise oscerr.PackageNotInstalled("obs-service-"+name)
|
||||
c = "/usr/lib/obs/service/" + call + " --outdir " + temp_dir
|
||||
if conf.config['verbose'] > 1:
|
||||
print "Run source service:", c
|
||||
|
@ -101,13 +101,15 @@ class OscIOError(OscBaseError):
|
||||
self.e = e
|
||||
self.msg = msg
|
||||
|
||||
class ServiceNotInstalled(OscBaseError):
|
||||
class PackageNotInstalled(OscBaseError):
|
||||
"""
|
||||
Exception raised when a service is not installed on local system
|
||||
Exception raised when a package is not installed on local system
|
||||
"""
|
||||
def __init__(self, msg):
|
||||
OscBaseError.__init__(self)
|
||||
self.msg = msg
|
||||
def __init__(self, pkg):
|
||||
OscBaseError.__init__(self, pkg)
|
||||
|
||||
def __str__(self):
|
||||
return 'Package %s is required for this operation' % ''.join(self.args)
|
||||
|
||||
class SignalInterrupt(Exception):
|
||||
"""Exception raised on SIGTERM and SIGHUP."""
|
||||
|
Loading…
Reference in New Issue
Block a user