From: krishnaa96 Date: Wed, 7 Apr 2021 06:34:28 +0000 (+0530) Subject: Return translation error when demand is empty X-Git-Tag: 2.2.0~8 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=1a15ae246b3896b183d648a3c855f0f13ff01bcf;p=optf%2Fhas.git 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 --- 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")