From 1a15ae246b3896b183d648a3c855f0f13ff01bcf Mon Sep 17 00:00:00 2001 From: krishnaa96 Date: Wed, 7 Apr 2021 12:04:28 +0530 Subject: Return translation error when demand is empty HAS returns exception when the demand is empty. Now, HAS will returns translattion error when demand is empty Issue-ID: OPTFRA-511 Signed-off-by: krishnaa96 Change-Id: I56ae57e9d2411dfd9a770cd6e28ea6c68439c5b8 --- conductor/conductor/controller/translator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conductor/conductor/controller/translator.py b/conductor/conductor/controller/translator.py index dc234cd..fe92acd 100644 --- a/conductor/conductor/controller/translator.py +++ b/conductor/conductor/controller/translator.py @@ -297,6 +297,8 @@ class Translator(object): def parse_demands(self, demands): """Validate/prepare demands for use by the solver.""" + if not demands: + raise TranslatorException("demand is not provided in the template") if type(demands) is not dict: raise TranslatorException("Demands must be provided in " "dictionary form") -- cgit 1.2.3-korg