diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-03-12 20:39:50 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-03-12 20:39:50 +0000 |
| commit | f4a3b2cc92b83459d3633c33fed7f680fe887b3c (patch) | |
| tree | 2771e6635e30fba95d6993b9ff1f60c55b4de035 | |
| parent | 641b68b0ad756196fb3ebc89ffd03c29a1d01cd4 (diff) | |
| parent | 35ec9f3c251c1bed1980108a4645485fbf39a3d3 (diff) | |
| download | nova-f4a3b2cc92b83459d3633c33fed7f680fe887b3c.tar.gz nova-f4a3b2cc92b83459d3633c33fed7f680fe887b3c.tar.xz nova-f4a3b2cc92b83459d3633c33fed7f680fe887b3c.zip | |
Merge "Make nova-manage syslog check /var/log/messages."
| -rwxr-xr-x | bin/nova-manage | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/nova-manage b/bin/nova-manage index 0ae700b16..51ed6f2f1 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -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: |
