Code Duplication    Length = 10-10 lines in 2 locations

gvm/protocols/gmpv7.py 2 locations

@@ 6170-6179 (lines=10) @@
6167
        if schedule_id:
6168
            cmd.add_element("schedule", attrs={"id": schedule_id})
6169
6170
        if schedule_periods is not None:
6171
            if (
6172
                not isinstance(schedule_periods, numbers.Integral)
6173
                or schedule_periods < 0
6174
            ):
6175
                raise InvalidArgument(
6176
                    "schedule_periods must be an integer greater or equal "
6177
                    "than 0"
6178
                )
6179
            cmd.add_element("schedule_periods", str(schedule_periods))
6180
6181
        if alert_ids is not None:
6182
            if not _is_list_like(alert_ids):
@@ 2550-2559 (lines=10) @@
2547
        if schedule_id:
2548
            cmd.add_element("schedule", attrs={"id": schedule_id})
2549
2550
            if schedule_periods is not None:
2551
                if (
2552
                    not isinstance(schedule_periods, numbers.Integral)
2553
                    or schedule_periods < 0
2554
                ):
2555
                    raise InvalidArgument(
2556
                        "schedule_periods must be an integer greater or equal "
2557
                        "than 0"
2558
                    )
2559
                cmd.add_element("schedule_periods", str(schedule_periods))
2560
2561
        if observers is not None:
2562
            if not _is_list_like(observers):