Code Duplication    Length = 23-23 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 5063-5085 (lines=23) @@
5060
5061
        return self._send_xml_command(cmd)
5062
5063
    def get_nvt(self, nvt_oid: str):
5064
        """Request a single nvt
5065
5066
        Arguments:
5067
            nvt_oid: OID of an existing nvt
5068
5069
        Returns:
5070
            The response. See :py:meth:`send_command` for details.
5071
        """
5072
        cmd = XmlCommand("get_nvts")
5073
5074
        if not nvt_oid:
5075
            raise RequiredArgument(
5076
                function=self.get_nvt.__name__, argument='nvt_oid'
5077
            )
5078
5079
        cmd.set_attribute("nvt_oid", nvt_oid)
5080
5081
        # for single entity always request all details
5082
        cmd.set_attribute("details", "1")
5083
        cmd.set_attribute("preferences", "1")
5084
        cmd.set_attribute("preference_count", "1")
5085
        return self._send_xml_command(cmd)
5086
5087
    def get_nvt_families(self, *, sort_order: Optional[str] = None):
5088
        """Request a list of nvt families

gvm/protocols/gmpv7/gmpv7.py 1 location

@@ 3429-3451 (lines=23) @@
3426
3427
        return self._send_xml_command(cmd)
3428
3429
    def get_nvt(self, nvt_oid: str):
3430
        """Request a single nvt
3431
3432
        Arguments:
3433
            nvt_oid: OID of an existing nvt
3434
3435
        Returns:
3436
            The response. See :py:meth:`send_command` for details.
3437
        """
3438
        cmd = XmlCommand("get_nvts")
3439
3440
        if not nvt_oid:
3441
            raise RequiredArgument(
3442
                function=self.get_nvt.__name__, argument='nvt_oid'
3443
            )
3444
3445
        cmd.set_attribute("nvt_oid", nvt_oid)
3446
3447
        # for single entity always request all details
3448
        cmd.set_attribute("details", "1")
3449
        cmd.set_attribute("preferences", "1")
3450
        cmd.set_attribute("preference_count", "1")
3451
        return self._send_xml_command(cmd)
3452
3453
    def get_nvt_families(self, *, sort_order: Optional[str] = None):
3454
        """Request a list of nvt families