Bug 812: workaround for 'max-instance-count' parsing error 35/7835/4
authorkuuse <johan.kuuse@altran.com>
Wed, 7 Aug 2019 12:43:44 +0000 (14:43 +0200)
committerkuuse <johan.kuuse@altran.com>
Thu, 8 Aug 2019 07:36:10 +0000 (09:36 +0200)
Change-Id: Ia2c80565c91054921978e06c3e4823a50aa1ed13
Signed-off-by: kuuse <johan.kuuse@altran.com>
osm_lcm/ns.py

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