From cf62af3ade18ddfebd379377adc635d86d3d091f Mon Sep 17 00:00:00 2001 From: Michael Hanselmann Date: Tue, 5 Feb 2013 13:51:30 +0100 Subject: [PATCH] qa_config: Simplify IsTemplateSupported MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The same code can be written in a single expression. The earlier patch named “Refactor storage of runtime exclusive storage flag in QA” provided the unit test. Signed-off-by: Michael Hanselmann Reviewed-by: Helga Velroyen --- qa/qa_config.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/qa/qa_config.py b/qa/qa_config.py index 7ccbfdd..b73ee63 100644 --- a/qa/qa_config.py +++ b/qa/qa_config.py @@ -176,10 +176,8 @@ class _QaConfig(object): """Is the given disk template supported by the current configuration? """ - if self.GetExclusiveStorage(): - return templ in constants.DTS_EXCL_STORAGE - else: - return True + return (not self.GetExclusiveStorage() or + templ in constants.DTS_EXCL_STORAGE) def Load(path): -- 1.7.10.4