From: kuuse Date: Wed, 7 Aug 2019 12:43:44 +0000 (+0200) Subject: Bug 812: workaround for 'max-instance-count' parsing error X-Git-Tag: v6.0.2rc1~5 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=818d70c467e1ae3f7fc4faf4a6bc711393c5f175;p=osm%2FLCM.git Bug 812: workaround for 'max-instance-count' parsing error Change-Id: Ia2c80565c91054921978e06c3e4823a50aa1ed13 Signed-off-by: kuuse --- 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"