Code Duplication    Length = 28-32 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 2 locations

@@ 5879-5910 (lines=32) @@
5876
5877
        return self._send_xml_command(cmd)
5878
5879
    def verify_report_format(
5880
        self, report_format_id: Union[str, ReportFormatType]
5881
    ) -> Any:
5882
        """Verify an existing report format
5883
5884
        Verifies the trust level of an existing report format. It will be
5885
        checked whether the signature of the report format currently matches the
5886
        report format. This includes the script and files used to generate
5887
        reports of this format. It is *not* verified if the report format works
5888
        as expected by the user.
5889
5890
        Arguments:
5891
            report_format_id: UUID of the report format to be verified
5892
                              or ReportFormatType (enum)
5893
5894
        Returns:
5895
            The response. See :py:meth:`send_command` for details.
5896
        """
5897
        if not report_format_id:
5898
            raise RequiredArgument(
5899
                function=self.verify_report_format.__name__,
5900
                argument='report_format_id',
5901
            )
5902
5903
        cmd = XmlCommand("verify_report_format")
5904
5905
        if isinstance(report_format_id, ReportFormatType):
5906
            report_format_id = report_format_id.value
5907
5908
        cmd.set_attribute("report_format_id", report_format_id)
5909
5910
        return self._send_xml_command(cmd)
5911
5912
    def verify_scanner(self, scanner_id: str) -> Any:
5913
        """Verify an existing scanner
@@ 4485-4512 (lines=28) @@
4482
4483
        return self._send_xml_command(cmd)
4484
4485
    def get_report_format(
4486
        self, report_format_id: Union[str, ReportFormatType]
4487
    ) -> Any:
4488
        """Request a single report format
4489
4490
        Arguments:
4491
            report_format_id: UUID of an existing report format
4492
                              or ReportFormatType (enum)
4493
4494
        Returns:
4495
            The response. See :py:meth:`send_command` for details.
4496
        """
4497
        cmd = XmlCommand("get_report_formats")
4498
4499
        if not report_format_id:
4500
            raise RequiredArgument(
4501
                function=self.get_report_format.__name__,
4502
                argument='report_format_id',
4503
            )
4504
4505
        if isinstance(report_format_id, ReportFormatType):
4506
            report_format_id = report_format_id.value
4507
4508
        cmd.set_attribute("report_format_id", report_format_id)
4509
4510
        # for single entity always request all details
4511
        cmd.set_attribute("details", "1")
4512
        return self._send_xml_command(cmd)
4513
4514
    def get_roles(
4515
        self,