Skip to content

Commit

Permalink
Make nova-manage syslog check /var/log/messages.
Browse files Browse the repository at this point in the history
Updates nova-manage syslog so that it checks /var/log/messages.

Fixes LP Bug #953354.

Change-Id: I0b4b61225285e9f0668f6f0af3928896e2700840
  • Loading branch information
dprince committed Mar 12, 2012
1 parent b057ab6 commit 35ec9f3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bin/nova-manage
Expand Up @@ -1971,7 +1971,15 @@ class GetLogCommands(object):
"""Get <num_entries> of the nova syslog events"""
entries = int(num_entries)
count = 0
lines = [line.strip() for line in open('/var/log/syslog', "r")]
log_file = ''
if os.path.exists('/var/log/syslog'):
log_file = '/var/log/syslog'
elif os.path.exists('/var/log/messages'):
log_file = '/var/log/messages'
else:
print "Unable to find system log file!"
sys.exit(1)
lines = [line.strip() for line in open(log_file, "r")]
lines.reverse()
print "Last %s nova syslog entries:-" % (entries)
for line in lines:
Expand Down

0 comments on commit 35ec9f3

Please sign in to comment.