Code Duplication    Length = 28-32 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 2 locations

@@ 6129-6160 (lines=32) @@
6126
6127
        return self._send_xml_command(cmd)
6128
6129
    def verify_report_format(
6130
        self, report_format_id: Union[str, ReportFormatType]
6131
    ) -> Any:
6132
        """Verify an existing report format
6133
6134
        Verifies the trust level of an existing report format. It will be
6135
        checked whether the signature of the report format currently matches the
6136
        report format. This includes the script and files used to generate
6137
        reports of this format. It is *not* verified if the report format works
6138
        as expected by the user.
6139
6140
        Arguments:
6141
            report_format_id: UUID of the report format to be verified
6142
                              or ReportFormatType (enum)
6143
6144
        Returns:
6145
            The response. See :py:meth:`send_command` for details.
6146
        """
6147
        if not report_format_id:
6148
            raise RequiredArgument(
6149
                function=self.verify_report_format.__name__,
6150
                argument='report_format_id',
6151
            )
6152
6153
        cmd = XmlCommand("verify_report_format")
6154
6155
        if isinstance(report_format_id, ReportFormatType):
6156
            report_format_id = report_format_id.value
6157
6158
        cmd.set_attribute("report_format_id", report_format_id)
6159
6160
        return self._send_xml_command(cmd)
6161
6162
    def verify_scanner(self, scanner_id: str) -> Any:
6163
        """Verify an existing scanner
@@ 4672-4699 (lines=28) @@
4669
4670
        return self._send_xml_command(cmd)
4671
4672
    def get_report_format(
4673
        self, report_format_id: Union[str, ReportFormatType]
4674
    ) -> Any:
4675
        """Request a single report format
4676
4677
        Arguments:
4678
            report_format_id: UUID of an existing report format
4679
                              or ReportFormatType (enum)
4680
4681
        Returns:
4682
            The response. See :py:meth:`send_command` for details.
4683
        """
4684
        cmd = XmlCommand("get_report_formats")
4685
4686
        if not report_format_id:
4687
            raise RequiredArgument(
4688
                function=self.get_report_format.__name__,
4689
                argument='report_format_id',
4690
            )
4691
4692
        if isinstance(report_format_id, ReportFormatType):
4693
            report_format_id = report_format_id.value
4694
4695
        cmd.set_attribute("report_format_id", report_format_id)
4696
4697
        # for single entity always request all details
4698
        cmd.set_attribute("details", "1")
4699
        return self._send_xml_command(cmd)
4700
4701
    def get_results(
4702
        self,