Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
event collection is now adjusted for new logging scheme, needs more t…
Browse files Browse the repository at this point in the history
…esting
  • Loading branch information
timf committed Oct 28, 2010
1 parent 4807293 commit aecb09a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
7 changes: 3 additions & 4 deletions etc/epumgmt/events.conf
Expand Up @@ -4,11 +4,10 @@

# 1. A common place on every VM instance where the logs with events exist
# (this is the "vmlogdir" configuration here).
# 2. Logfiles are named *.log
# 3. A common user login for every VM instance (configured in iaas.conf)
# 4. The localsshkeypath configuration in iaas.conf allows access.
# 2. A common user login for every VM instance (configured in iaas.conf)
# 3. The localsshkeypath configuration in iaas.conf allows access.

vmlogdir: /home/cc/lcaarch
vmlogdir: /home/cc/lcaarch/logs


# Path to the per-run log directory. Under this, a subdirectory per run
Expand Down
20 changes: 15 additions & 5 deletions src/python/epumgmt/defaults/event_gather.py
Expand Up @@ -69,9 +69,19 @@ def _fill_one(self, vm):

def _all_events_in_dir(self, logdir):
events = []
for root, dirs, files in os.walk(logdir):
for name in files:
path = os.path.join(root, name)
events.extend(cyvents.events_from_file(path))
break # only look in the top directory
for fullpath in self.dirwalk(logdir):
self.c.log.debug("Looking in '%s'" % fullpath)
events.extend(cyvents.events_from_file(fullpath))
return events

def dirwalk(self, adir):
"""walk a directory tree, using a generator,
http://code.activestate.com/recipes/105873-walk-a-directory-tree-using-a-generator/
"""
for f in os.listdir(adir):
fullpath = os.path.join(adir,f)
if os.path.isdir(fullpath) and not os.path.islink(fullpath):
for x in self.dirwalk(fullpath): # recurse into subdir
yield x
else:
yield fullpath
3 changes: 0 additions & 3 deletions src/python/epumgmt/defaults/runlogs.py
Expand Up @@ -96,9 +96,6 @@ def fetch_logs(self, vm, m):
# last arg is "user@host:", we need to enhance this with the path
scpcmd[-1] = scpcmd[-1] + vm.vmlogdir

# and then the glob
scpcmd[-1] = scpcmd[-1] + "/*.log*"

# transfer destination
scpcmd.append(vm.runlogdir)

Expand Down

0 comments on commit aecb09a

Please sign in to comment.