Return translation error when demand is empty 50/120250/1
authorkrishnaa96 <krishna.moorthy6@wipro.com>
Wed, 7 Apr 2021 06:34:28 +0000 (12:04 +0530)
committerkrishnaa96 <krishna.moorthy6@wipro.com>
Wed, 7 Apr 2021 06:36:33 +0000 (12:06 +0530)
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 <krishna.moorthy6@wipro.com>
Change-Id: I56ae57e9d2411dfd9a770cd6e28ea6c68439c5b8

conductor/conductor/controller/translator.py

index dc234cd..fe92acd 100644 (file)
@@ -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")