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

Update ivan log statements #28

Merged
merged 2 commits into from Aug 31, 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

Prev

fix regex to look for rsyslogd instead of rsyslog

  • Loading branch information
rhigdon committed Aug 31, 2013
commit a550e78a2f7e8d08b447b2c1bedfea73a593e907
@@ -408,27 +408,27 @@ def get_syslog_version(verify_config_paths=False):

SYSLOG_PATHS = [
# (syslog type, command, conf path, conf.d path)
("rsyslog", "rsyslogd -v", "/etc/rsyslog.conf", "/etc/rsyslog.d/"),
("syslog-ng", "syslog-ng --version", "/etc/syslog-ng/syslog-ng.conf", "/etc/syslog-ng/")
("rsyslog", "rsyslogd", "-v", "/etc/rsyslog.conf", "/etc/rsyslog.d/"),
("syslog-ng", "syslog-ng", "--version", "/etc/syslog-ng/syslog-ng.conf", "/etc/syslog-ng/")
]

for s in SYSLOG_PATHS:

p = subprocess.Popen(s[1], shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
p = subprocess.Popen(s[1] + ' ' + s[2], shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
p.wait()
if p.returncode != 0:
continue

version_line = p.stdout.readlines()[0]

if verify_config_paths:
if not os.path.isfile(s[2]) or not os.path.isdir(s[3]):
if not os.path.isfile(s[3]) or not os.path.isdir(s[4]):
continue

# extract the version number from the daemon's version report,
# only cares about the major and minor version numbers and ignores
# the point number.
version_pattern = r'%s (\d+\.+\d)' % s[0]
version_pattern = r'%s (\d+\.+\d)' % s[1]
version_string = re.search(version_pattern, version_line).group(1)

return [(s[0], version_string)]
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.