Skip to content

Commit

Permalink
Add safeguard for parsing top command
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-veit committed Aug 5, 2024
1 parent d54b2aa commit 7c335e7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
Change Log
==========

5.4.2
=====

* Safeguard against unexpected output from top command


5.4.1
=====

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tibanna"
version = "5.4.1"
version = "5.4.2"
description = "Tibanna runs portable pipelines (in CWL/WDL) on the AWS Cloud."
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand Down
9 changes: 8 additions & 1 deletion tibanna/top.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import datetime
from . import create_logger

logger = create_logger(__name__)


class Top(object):
Expand Down Expand Up @@ -100,7 +103,11 @@ def parse_contents(self, contents):
if is_in_table:
if timestamp not in self.processes:
self.processes[timestamp] = []
process = Process(line)
try:
process = Process(line)
except:
logger.info(f"Could not process line from top command: {line}")
continue
if not self.should_skip_process(process):
self.processes[timestamp].append(Process(line))

Expand Down

0 comments on commit 7c335e7

Please sign in to comment.