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

@@ 2482-2506 (lines=25) @@
2479
2480
        return self._send_xml_command(cmd)
2481
2482
    def get_feed(self, feed_type: Optional[FeedType]) -> Any:
2483
        """Request a single feed
2484
2485
        Arguments:
2486
            feed_type: Type of single feed to get: NVT, CERT or SCAP
2487
2488
        Returns:
2489
            The response. See :py:meth:`send_command` for details.
2490
        """
2491
        if not feed_type:
2492
            raise RequiredArgument(
2493
                function=self.get_feed.__name__, argument='feed_type'
2494
            )
2495
2496
        if not isinstance(feed_type, FeedType):
2497
            raise InvalidArgumentType(
2498
                function=self.get_feed.__name__,
2499
                argument='feed_type',
2500
                arg_type=FeedType.__name__,
2501
            )
2502
2503
        cmd = XmlCommand("get_feeds")
2504
        cmd.set_attribute("type", feed_type.value)
2505
2506
        return self._send_xml_command(cmd)
2507
2508
    def create_credential(
2509
        self,