diff --git a/sau/gentoo.py b/sau/gentoo.py index 3f94b4c..67a9ca3 100644 --- a/sau/gentoo.py +++ b/sau/gentoo.py @@ -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