Code Duplication    Length = 26-26 lines in 2 locations

gvm/protocols/gmpv7/gmpv7.py 1 location

@@ 3625-3650 (lines=26) @@
3622
        cmd.set_attribute("details", "1")
3623
        return self._send_xml_command(cmd)
3624
3625
    def get_preferences(
3626
        self, *, nvt_oid: Optional[str] = None, config_id: Optional[str] = None
3627
    ) -> Any:
3628
        """Request a list of preferences
3629
3630
        When the command includes a config_id attribute, the preference element
3631
        includes the preference name, type and value, and the NVT to which the
3632
        preference applies. Otherwise, the preference element includes just the
3633
        name and value, with the NVT and type built into the name.
3634
3635
        Arguments:
3636
            nvt_oid: OID of nvt
3637
            config_id: UUID of scan config of which to show preference values
3638
3639
        Returns:
3640
            The response. See :py:meth:`send_command` for details.
3641
        """
3642
        cmd = XmlCommand("get_preferences")
3643
3644
        if nvt_oid:
3645
            cmd.set_attribute("nvt_oid", nvt_oid)
3646
3647
        if config_id:
3648
            cmd.set_attribute("config_id", config_id)
3649
3650
        return self._send_xml_command(cmd)
3651
3652
    def get_preference(
3653
        self,

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 5291-5316 (lines=26) @@
5288
        cmd.set_attribute("details", "1")
5289
        return self._send_xml_command(cmd)
5290
5291
    def get_preferences(
5292
        self, *, nvt_oid: Optional[str] = None, config_id: Optional[str] = None
5293
    ) -> Any:
5294
        """Request a list of preferences
5295
5296
        When the command includes a config_id attribute, the preference element
5297
        includes the preference name, type and value, and the NVT to which the
5298
        preference applies. Otherwise, the preference element includes just the
5299
        name and value, with the NVT and type built into the name.
5300
5301
        Arguments:
5302
            nvt_oid: OID of nvt
5303
            config_id: UUID of scan config of which to show preference values
5304
5305
        Returns:
5306
            The response. See :py:meth:`send_command` for details.
5307
        """
5308
        cmd = XmlCommand("get_preferences")
5309
5310
        if nvt_oid:
5311
            cmd.set_attribute("nvt_oid", nvt_oid)
5312
5313
        if config_id:
5314
            cmd.set_attribute("config_id", config_id)
5315
5316
        return self._send_xml_command(cmd)
5317
5318
    def get_preference(
5319
        self,