fixed pkg parsing in freebsd
This commit is contained in:
parent
6f69be3f6a
commit
45eefb251b
@ -23,13 +23,13 @@ def identify_service_from_bin(exe):
|
||||
ret, pkg, err = sau.helpers.exec_cmd(cmd)
|
||||
if not pkg:
|
||||
raise sau.errors.UnknownServiceError("'{}' does not belong to any package".format(exe))
|
||||
pkg = pkg.decode('utf-8').strip()
|
||||
pkg = pkg.strip()
|
||||
|
||||
log.debug('{} belongs to package {}'.format(exe, pkg))
|
||||
cmd = [ PKG_PATH, 'info', '-l', pkg ]
|
||||
ret, out, err = sau.helpers.exec_cmd(cmd)
|
||||
rc_scripts = set()
|
||||
for line in out.decode('utf-8').splitlines():
|
||||
for line in out.splitlines():
|
||||
match = re.match(rc_script_re, line.strip())
|
||||
if match:
|
||||
log.debug('found potential rc-script for {} at {}'.format(exe, match.group(1)))
|
||||
|
Loading…
Reference in New Issue
Block a user