Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log old python #54

Merged
merged 6 commits into from Oct 14, 2013
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

don't use bytes literals -- python2.5 doesn't like them

  • Loading branch information
Mike Blume
Mike Blume committed Oct 10, 2013
commit 9715ecb7ca02ef80fec4c2a3a55163af3865cb65
@@ -536,18 +536,14 @@ def find_syslog_process():
if results:
#For python version 3 and above, reading binary data, not str,
#so we need to decode the output first:
reslines = results.split(b'\n')
reslines = results.split('\n')
if len(reslines) == 1:
ps_out_fields = reslines[0].split()
pid = int(ps_out_fields[1])
progname = ps_out_fields[7]
if b'/' in progname:
progname = progname.split(b'/')[-1]
try:
return (progname.decode('UTF-8'), pid)
except ValueError:
# if progname won't decode, it's not a progname we know.
pass
if '/' in progname:
progname = progname.split('/')[-1]
return progname, pid
return None, 0

def check_syslog_service_status(syslog_type):
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.