Code Duplication    Length = 10-10 lines in 2 locations

gvm/protocols/gmpv7.py 2 locations

@@ 1916-1925 (lines=10) @@
1913
        if schedule_id:
1914
            cmd.add_element("schedule", attrs={"id": schedule_id})
1915
1916
            if schedule_periods is not None:
1917
                if (
1918
                    not isinstance(schedule_periods, numbers.Integral)
1919
                    or schedule_periods < 0
1920
                ):
1921
                    raise InvalidArgument(
1922
                        "schedule_periods must be an integer greater or equal "
1923
                        "than 0"
1924
                    )
1925
                cmd.add_element("schedule_periods", str(schedule_periods))
1926
1927
        if observers is not None:
1928
            if not _is_list_like(observers):
@@ 5430-5439 (lines=10) @@
5427
        if schedule_id:
5428
            cmd.add_element("schedule", attrs={"id": schedule_id})
5429
5430
        if schedule_periods is not None:
5431
            if (
5432
                not isinstance(schedule_periods, numbers.Integral)
5433
                or schedule_periods < 0
5434
            ):
5435
                raise InvalidArgument(
5436
                    "schedule_periods must be an integer greater or equal "
5437
                    "than 0"
5438
                )
5439
            cmd.add_element("schedule_periods", str(schedule_periods))
5440
5441
        if alert_ids is not None:
5442
            if not _is_list_like(alert_ids):