From 6e478258339df9d42a16e8b61a3c62da159b923f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Szukie=C5=82oj=C4=87?= Date: Mon, 29 Aug 2016 14:36:26 +0200 Subject: [PATCH] Fix error report in version Change-Id: Id446953af0ef6a9f639aec60f1537e5e82c331fe --- muranopkgcheck/tests/test_manifest_validator.py | 5 +++++ muranopkgcheck/validators/manifest.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/muranopkgcheck/tests/test_manifest_validator.py b/muranopkgcheck/tests/test_manifest_validator.py index 0a22256..deca66f 100644 --- a/muranopkgcheck/tests/test_manifest_validator.py +++ b/muranopkgcheck/tests/test_manifest_validator.py @@ -46,6 +46,11 @@ class ManifestValidatorTests(helpers.BaseValidatorTestClass): self.assertIn('Not supported format "Heat/1.0"', next(self.g).message) + def test_heat_format_invalid_version_also(self): + self.g = self.mv._valid_format('Heat/0.1.0') + self.assertIn('Not supported format "Heat/0.1.0"', + next(self.g).message) + def test_unsupported_format(self): self.g = self.mv._valid_format('Heat.HOT') self.assertIn('Not supported format version "Heat.HOT"', diff --git a/muranopkgcheck/validators/manifest.py b/muranopkgcheck/validators/manifest.py index e8d3c53..80e2357 100644 --- a/muranopkgcheck/validators/manifest.py +++ b/muranopkgcheck/validators/manifest.py @@ -42,8 +42,9 @@ class ManifestValidator(base.YamlValidator): format_ = str(value).split('/', 1) if len(format_) > 1: if format_[0] != 'MuranoPL': - yield error.report.E030('Not supported format "{0}"' + yield error.report.W030('Not supported format "{0}"' .format(value), value) + return ver = format_[-1] if str(ver) not in ['1.0', '1.1', '1.2', '1.3', '1.4']: yield error.report.W030('Not supported format version "{0}"'