Code Duplication    Length = 10-10 lines in 2 locations

gvm/protocols/gmpv7.py 2 locations

@@ 5502-5511 (lines=10) @@
5499
        if schedule_id:
5500
            cmd.add_element("schedule", attrs={"id": schedule_id})
5501
5502
        if schedule_periods is not None:
5503
            if (
5504
                not isinstance(schedule_periods, numbers.Integral)
5505
                or schedule_periods < 0
5506
            ):
5507
                raise InvalidArgument(
5508
                    "schedule_periods must be an integer greater or equal "
5509
                    "than 0"
5510
                )
5511
            cmd.add_element("schedule_periods", str(schedule_periods))
5512
5513
        if alert_ids is not None:
5514
            if not _is_list_like(alert_ids):
@@ 1941-1950 (lines=10) @@
1938
        if schedule_id:
1939
            cmd.add_element("schedule", attrs={"id": schedule_id})
1940
1941
            if schedule_periods is not None:
1942
                if (
1943
                    not isinstance(schedule_periods, numbers.Integral)
1944
                    or schedule_periods < 0
1945
                ):
1946
                    raise InvalidArgument(
1947
                        "schedule_periods must be an integer greater or equal "
1948
                        "than 0"
1949
                    )
1950
                cmd.add_element("schedule_periods", str(schedule_periods))
1951
1952
        if observers is not None:
1953
            if not _is_list_like(observers):