proper error message on gentoo when service could not be identified.
This commit is contained in:
parent
688af9ac62
commit
0ea7804427
@ -24,12 +24,7 @@ def identify_service_from_bin(exe):
|
||||
ret, out, err = sau.helpers.exec_cmd(cmd)
|
||||
|
||||
if ret != 0:
|
||||
log.warning("searching for owner of {} failed:".format(exe))
|
||||
for line in out.splitlines():
|
||||
log.warning("stdout: {}".format(line))
|
||||
for line in err.splitlines():
|
||||
log.warning("stderr: {}".format(line))
|
||||
return None
|
||||
raise sau.errors.UnknownServiceError("searching for owner of {} failed:".format(exe))
|
||||
|
||||
pkg = out.strip()
|
||||
cmd = [ EQUERY_PATH, '-Cq', 'f', pkg ]
|
||||
@ -48,9 +43,9 @@ def identify_service_from_bin(exe):
|
||||
if match:
|
||||
matches.add(match.group(1))
|
||||
if len(matches) < 1:
|
||||
log.warning('Could not find any init script in package {}'.format(pkg))
|
||||
raise sau.errors.UnknownServiceError('Could not find any init script in package {}'.format(pkg))
|
||||
elif len(matches) > 1:
|
||||
log.warning('Found multiple init script in package {}'.format(pkg))
|
||||
raise sau.errors.UnknownServiceError('Found multiple init script in package {}'.format(pkg))
|
||||
else:
|
||||
return matches.pop()
|
||||
return None
|
||||
|
Loading…
Reference in New Issue
Block a user