Code Duplication    Length = 28-32 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 2 locations

@@ 7226-7257 (lines=32) @@
7223
7224
        return self._send_xml_command(cmd)
7225
7226
    def verify_report_format(
7227
        self, report_format_id: Union[str, ReportFormatType]
7228
    ) -> Any:
7229
        """Verify an existing report format
7230
7231
        Verifies the trust level of an existing report format. It will be
7232
        checked whether the signature of the report format currently matches the
7233
        report format. This includes the script and files used to generate
7234
        reports of this format. It is *not* verified if the report format works
7235
        as expected by the user.
7236
7237
        Arguments:
7238
            report_format_id: UUID of the report format to be verified
7239
                              or ReportFormatType (enum)
7240
7241
        Returns:
7242
            The response. See :py:meth:`send_command` for details.
7243
        """
7244
        if not report_format_id:
7245
            raise RequiredArgument(
7246
                function=self.verify_report_format.__name__,
7247
                argument='report_format_id',
7248
            )
7249
7250
        cmd = XmlCommand("verify_report_format")
7251
7252
        if isinstance(report_format_id, ReportFormatType):
7253
            report_format_id = report_format_id.value
7254
7255
        cmd.set_attribute("report_format_id", report_format_id)
7256
7257
        return self._send_xml_command(cmd)
7258
7259
    def verify_scanner(self, scanner_id: str) -> Any:
7260
        """Verify an existing scanner
@@ 5368-5395 (lines=28) @@
5365
5366
        return self._send_xml_command(cmd)
5367
5368
    def get_report_format(
5369
        self, report_format_id: Union[str, ReportFormatType]
5370
    ) -> Any:
5371
        """Request a single report format
5372
5373
        Arguments:
5374
            report_format_id: UUID of an existing report format
5375
                              or ReportFormatType (enum)
5376
5377
        Returns:
5378
            The response. See :py:meth:`send_command` for details.
5379
        """
5380
        cmd = XmlCommand("get_report_formats")
5381
5382
        if not report_format_id:
5383
            raise RequiredArgument(
5384
                function=self.get_report_format.__name__,
5385
                argument='report_format_id',
5386
            )
5387
5388
        if isinstance(report_format_id, ReportFormatType):
5389
            report_format_id = report_format_id.value
5390
5391
        cmd.set_attribute("report_format_id", report_format_id)
5392
5393
        # for single entity always request all details
5394
        cmd.set_attribute("details", "1")
5395
        return self._send_xml_command(cmd)
5396
5397
    def get_results(
5398
        self,