summaryrefslogtreecommitdiffstats
path: root/conductor
diff options
context:
space:
mode:
authorkrishnaa96 <krishna.moorthy6@wipro.com>2021-04-07 12:04:28 +0530
committerkrishnaa96 <krishna.moorthy6@wipro.com>2021-04-07 12:06:33 +0530
commit1a15ae246b3896b183d648a3c855f0f13ff01bcf (patch)
treeb0d37fce8507b3de6549f86a12057a86c94b1674 /conductor
parent8ed15a480518cb85bb6442e94759c4c6981d2017 (diff)
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 <krishna.moorthy6@wipro.com> Change-Id: I56ae57e9d2411dfd9a770cd6e28ea6c68439c5b8
Diffstat (limited to 'conductor')
-rw-r--r--conductor/conductor/controller/translator.py2
1 files changed, 2 insertions, 0 deletions
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")