From 818d70c467e1ae3f7fc4faf4a6bc711393c5f175 Mon Sep 17 00:00:00 2001 From: kuuse Date: Wed, 7 Aug 2019 14:43:44 +0200 Subject: [PATCH] Bug 812: workaround for 'max-instance-count' parsing error Change-Id: Ia2c80565c91054921978e06c3e4823a50aa1ed13 Signed-off-by: kuuse --- osm_lcm/ns.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index a8c6a8c..0330633 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -2272,14 +2272,12 @@ class NsLcm(LcmBase): vdu_scaling_info = {"scaling_group_name": scaling_group, "vdu": []} if scaling_type == "SCALE_OUT": # count if max-instance-count is reached - if "max-instance-count" in scaling_descriptor and scaling_descriptor["max-instance-count"] is not None: - max_instance_count = int(scaling_descriptor["max-instance-count"]) - - # self.logger.debug("MAX_INSTANCE_COUNT is {}".format(scaling_descriptor["max-instance-count"])) - if nb_scale_op >= max_instance_count: - raise LcmException("reached the limit of {} (max-instance-count) " - "scaling-out operations for the " - "scaling-group-descriptor '{}'".format(nb_scale_op, scaling_group)) + max_instance_count = scaling_descriptor.get("max-instance-count", 10) + # self.logger.debug("MAX_INSTANCE_COUNT is {}".format(max_instance_count)) + if nb_scale_op >= max_instance_count: + raise LcmException("reached the limit of {} (max-instance-count) " + "scaling-out operations for the " + "scaling-group-descriptor '{}'".format(nb_scale_op, scaling_group)) nb_scale_op += 1 vdu_scaling_info["scaling_direction"] = "OUT" -- 2.25.1