Browse Source

Don't mess up output by matching newlines

tags/0.2.1
Johann Schmitz 3 years ago
parent
commit
7b0fa1c3de
2 changed files with 3 additions and 3 deletions
  1. 2
    2
      src/smartcheck/check.py
  2. 1
    1
      src/smartcheck/main.py

+ 2
- 2
src/smartcheck/check.py View File

@@ -24,7 +24,7 @@ INFORMATION_RE = [
DATA_RE = [
('overall_health_status', re.compile('SMART overall-health self-assessment test result: (.*)', re.UNICODE)),
]
DATA_ATTRIBUTES_RE = re.compile(r"\s*(\d+)\s+([\w\d_\-]+)\s+([0-9a-fx]+)\s+(\d+)\s+(\d+)\s+(\d+)\s+([\w\d_\-]+)\s+([\w\d]+)\s+([\w\d_\-]+)\s+(.*)", re.UNICODE)
DATA_ATTRIBUTES_RE = re.compile(r"\s*(\d+)\s+([\w\d_\-]+)\s+([0-9a-fx]+)\s+(\d+)\s+(\d+)\s+(\d+)\s+([\w\d_\-]+)\s+([\w\d]+)\s+([\w\d_\-]+)\s+([^\r\n]*)", re.UNICODE)

TEST_RESULT_RE = re.compile(r"#\s*(\d+)\s+(.*?)\s{2,}(.*?)\s{2,}\s+([\d%]+)\s+(\d+)\s+(\d+|-)", re.UNICODE)

@@ -44,7 +44,7 @@ class AttributeWarning(object):
self.level = level
self.field = attribute_name
self.value = value
self.description = description
self.description = (description or '').strip()

@property
def short_message(self):

+ 1
- 1
src/smartcheck/main.py View File

@@ -86,7 +86,7 @@ if __name__ == "__main__":
exit_code = 2

if not check.check_tests():
msg = (msg + '; S.M.A.R.T. self test reported an error').lstrip(';').strip()
msg = (msg.strip() + '; S.M.A.R.T. self test reported an error').lstrip(';').strip()
exit_code = 2

if not exit_code:

Loading…
Cancel
Save