Code Duplication    Length = 26-26 lines in 2 locations

gvm/protocols/gmpv7.py 2 locations

@@ 1157-1182 (lines=26) @@
1154
        if comment:
1155
            cmd.add_element('comment', comment)
1156
1157
        if first_time_minute or first_time_hour or first_time_day_of_month or \
1158
            first_time_month or first_time_year:
1159
1160
            if not first_time_minute:
1161
                raise RequiredArgument(
1162
                    'Setting first_time requires first_time_minute argument')
1163
            if not first_time_hour:
1164
                raise RequiredArgument(
1165
                    'Setting first_time requires first_time_hour argument')
1166
            if not first_time_day_of_month:
1167
                raise RequiredArgument(
1168
                    'Setting first_time requires first_time_day_of_month '
1169
                    'argument')
1170
            if not first_time_month:
1171
                raise RequiredArgument(
1172
                    'Setting first_time requires first_time_month argument')
1173
            if not first_time_year:
1174
                raise RequiredArgument(
1175
                    'Setting first_time requires first_time_year argument')
1176
1177
            _xmlftime = cmd.add_element('first_time')
1178
            _xmlftime.add_element('minute', str(first_time_minute))
1179
            _xmlftime.add_element('hour', str(first_time_hour))
1180
            _xmlftime.add_element('day_of_month', str(first_time_day_of_month))
1181
            _xmlftime.add_element('month', str(first_time_month))
1182
            _xmlftime.add_element('year', str(first_time_year))
1183
1184
        if duration:
1185
            if not duration_unit:
@@ 3987-4012 (lines=26) @@
3984
        if name:
3985
            cmd.add_element('name', name)
3986
3987
        if first_time_minute or first_time_hour or first_time_day_of_month or \
3988
            first_time_month or first_time_year:
3989
3990
            if not first_time_minute:
3991
                raise RequiredArgument(
3992
                    'Setting first_time requires first_time_minute argument')
3993
            if not first_time_hour:
3994
                raise RequiredArgument(
3995
                    'Setting first_time requires first_time_hour argument')
3996
            if not first_time_day_of_month:
3997
                raise RequiredArgument(
3998
                    'Setting first_time requires first_time_day_of_month '
3999
                    'argument')
4000
            if not first_time_month:
4001
                raise RequiredArgument(
4002
                    'Setting first_time requires first_time_month argument')
4003
            if not first_time_year:
4004
                raise RequiredArgument(
4005
                    'Setting first_time requires first_time_year argument')
4006
4007
            _xmlftime = cmd.add_element('first_time')
4008
            _xmlftime.add_element('minute', str(first_time_minute))
4009
            _xmlftime.add_element('hour', str(first_time_hour))
4010
            _xmlftime.add_element('day_of_month', str(first_time_day_of_month))
4011
            _xmlftime.add_element('month', str(first_time_month))
4012
            _xmlftime.add_element('year', str(first_time_year))
4013
4014
        if duration:
4015
            if not duration_unit: