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

@@ 2450-2474 (lines=25) @@
2447
2448
        return self._send_xml_command(cmd)
2449
2450
    def get_feed(self, feed_type: Optional[FeedType]) -> Any:
2451
        """Request a single feed
2452
2453
        Arguments:
2454
            feed_type: Type of single feed to get: NVT, CERT or SCAP
2455
2456
        Returns:
2457
            The response. See :py:meth:`send_command` for details.
2458
        """
2459
        if not feed_type:
2460
            raise RequiredArgument(
2461
                function=self.get_feed.__name__, argument='feed_type'
2462
            )
2463
2464
        if not isinstance(feed_type, FeedType):
2465
            raise InvalidArgumentType(
2466
                function=self.get_feed.__name__,
2467
                argument='feed_type',
2468
                arg_type=FeedType.__name__,
2469
            )
2470
2471
        cmd = XmlCommand("get_feeds")
2472
        cmd.set_attribute("type", feed_type.value)
2473
2474
        return self._send_xml_command(cmd)
2475
2476
    def create_credential(
2477
        self,