From cf62af3ade18ddfebd379377adc635d86d3d091f Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Tue, 5 Feb 2013 13:51:30 +0100 Subject: [PATCH] qa_config: Simplify IsTemplateSupported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 <hansmi@google.com> Reviewed-by: Helga Velroyen <helgav@google.com> --- 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 7ccbfdd6e..b73ee638f 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): -- GitLab