Code Duplication    Length = 23-23 lines in 2 locations

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

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 5095-5117 (lines=23) @@
5092
5093
        return self._send_xml_command(cmd)
5094
5095
    def get_nvt(self, nvt_oid: str):
5096
        """Request a single nvt
5097
5098
        Arguments:
5099
            nvt_oid: OID of an existing nvt
5100
5101
        Returns:
5102
            The response. See :py:meth:`send_command` for details.
5103
        """
5104
        cmd = XmlCommand("get_nvts")
5105
5106
        if not nvt_oid:
5107
            raise RequiredArgument(
5108
                function=self.get_nvt.__name__, argument='nvt_oid'
5109
            )
5110
5111
        cmd.set_attribute("nvt_oid", nvt_oid)
5112
5113
        # for single entity always request all details
5114
        cmd.set_attribute("details", "1")
5115
        cmd.set_attribute("preferences", "1")
5116
        cmd.set_attribute("preference_count", "1")
5117
        return self._send_xml_command(cmd)
5118
5119
    def get_nvt_families(self, *, sort_order: Optional[str] = None):
5120
        """Request a list of nvt families