Code Duplication    Length = 26-26 lines in 2 locations

gvm/protocols/gmpv7.py 2 locations

@@ 3884-3909 (lines=26) @@
3881
        if name:
3882
            cmd.add_element('name', name)
3883
3884
        if first_time_minute or first_time_hour or first_time_day_of_month or \
3885
            first_time_month or first_time_year:
3886
3887
            if not first_time_minute:
3888
                raise RequiredArgument(
3889
                    'Setting first_time requires first_time_minute argument')
3890
            if not first_time_hour:
3891
                raise RequiredArgument(
3892
                    'Setting first_time requires first_time_hour argument')
3893
            if not first_time_day_of_month:
3894
                raise RequiredArgument(
3895
                    'Setting first_time requires first_time_day_of_month '
3896
                    'argument')
3897
            if not first_time_month:
3898
                raise RequiredArgument(
3899
                    'Setting first_time requires first_time_month argument')
3900
            if not first_time_year:
3901
                raise RequiredArgument(
3902
                    'Setting first_time requires first_time_year argument')
3903
3904
            _xmlftime = cmd.add_element('first_time')
3905
            _xmlftime.add_element('minute', str(first_time_minute))
3906
            _xmlftime.add_element('hour', str(first_time_hour))
3907
            _xmlftime.add_element('day_of_month', str(first_time_day_of_month))
3908
            _xmlftime.add_element('month', str(first_time_month))
3909
            _xmlftime.add_element('year', str(first_time_year))
3910
3911
        if duration:
3912
            if not duration_unit:
@@ 1077-1102 (lines=26) @@
1074
        if comment:
1075
            cmd.add_element('comment', comment)
1076
1077
        if first_time_minute or first_time_hour or first_time_day_of_month or \
1078
            first_time_month or first_time_year:
1079
1080
            if not first_time_minute:
1081
                raise RequiredArgument(
1082
                    'Setting first_time requires first_time_minute argument')
1083
            if not first_time_hour:
1084
                raise RequiredArgument(
1085
                    'Setting first_time requires first_time_hour argument')
1086
            if not first_time_day_of_month:
1087
                raise RequiredArgument(
1088
                    'Setting first_time requires first_time_day_of_month '
1089
                    'argument')
1090
            if not first_time_month:
1091
                raise RequiredArgument(
1092
                    'Setting first_time requires first_time_month argument')
1093
            if not first_time_year:
1094
                raise RequiredArgument(
1095
                    'Setting first_time requires first_time_year argument')
1096
1097
            _xmlftime = cmd.add_element('first_time')
1098
            _xmlftime.add_element('minute', str(first_time_minute))
1099
            _xmlftime.add_element('hour', str(first_time_hour))
1100
            _xmlftime.add_element('day_of_month', str(first_time_day_of_month))
1101
            _xmlftime.add_element('month', str(first_time_month))
1102
            _xmlftime.add_element('year', str(first_time_year))
1103
1104
        if duration:
1105
            if not duration_unit: