Code Duplication    Length = 25-25 lines in 2 locations

gvm/protocols/gmpv7/gmpv7.py 1 location

@@ 3100-3124 (lines=25) @@
3097
        """
3098
        return self._send_xml_command(XmlCommand("get_feeds"))
3099
3100
    def get_feed(self, feed_type: Optional[FeedType]) -> Any:
3101
        """Request a single feed
3102
3103
        Arguments:
3104
            feed_type: Type of single feed to get: NVT, CERT or SCAP
3105
3106
        Returns:
3107
            The response. See :py:meth:`send_command` for details.
3108
        """
3109
        if not feed_type:
3110
            raise RequiredArgument(
3111
                function=self.get_feed.__name__, argument='feed_type'
3112
            )
3113
3114
        if not isinstance(feed_type, FeedType):
3115
            raise InvalidArgumentType(
3116
                function=self.get_feed.__name__,
3117
                argument='feed_type',
3118
                arg_type=FeedType.__name__,
3119
            )
3120
3121
        cmd = XmlCommand("get_feeds")
3122
        cmd.set_attribute("type", feed_type.value)
3123
3124
        return self._send_xml_command(cmd)
3125
3126
    def get_filters(
3127
        self,

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 358-382 (lines=25) @@
355
356
        return self._send_xml_command(cmd)
357
358
    def get_feed(self, feed_type: Optional[FeedType]) -> Any:
359
        """Request a single feed
360
361
        Arguments:
362
            feed_type: Type of single feed to get: NVT, CERT or SCAP
363
364
        Returns:
365
            The response. See :py:meth:`send_command` for details.
366
        """
367
        if not feed_type:
368
            raise RequiredArgument(
369
                function=self.get_feed.__name__, argument='feed_type'
370
            )
371
372
        if not isinstance(feed_type, FeedType):
373
            raise InvalidArgumentType(
374
                function=self.get_feed.__name__,
375
                argument='feed_type',
376
                arg_type=FeedType.__name__,
377
            )
378
379
        cmd = XmlCommand("get_feeds")
380
        cmd.set_attribute("type", feed_type.value)
381
382
        return self._send_xml_command(cmd)
383