Code Duplication    Length = 28-32 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 2 locations

@@ 4128-4159 (lines=32) @@
4125
        """
4126
        return self._send_xml_command(XmlCommand("sync_scap"))
4127
4128
    def verify_report_format(
4129
        self, report_format_id: Union[str, ReportFormatType]
4130
    ) -> Any:
4131
        """Verify an existing report format
4132
4133
        Verifies the trust level of an existing report format. It will be
4134
        checked whether the signature of the report format currently matches the
4135
        report format. This includes the script and files used to generate
4136
        reports of this format. It is *not* verified if the report format works
4137
        as expected by the user.
4138
4139
        Arguments:
4140
            report_format_id: UUID of the report format to be verified
4141
                              or ReportFormatType (enum)
4142
4143
        Returns:
4144
            The response. See :py:meth:`send_command` for details.
4145
        """
4146
        if not report_format_id:
4147
            raise RequiredArgument(
4148
                function=self.verify_report_format.__name__,
4149
                argument='report_format_id',
4150
            )
4151
4152
        cmd = XmlCommand("verify_report_format")
4153
4154
        if isinstance(report_format_id, ReportFormatType):
4155
            report_format_id = report_format_id.value
4156
4157
        cmd.set_attribute("report_format_id", report_format_id)
4158
4159
        return self._send_xml_command(cmd)
4160
4161
    def verify_scanner(self, scanner_id: str) -> Any:
4162
        """Verify an existing scanner
@@ 3000-3027 (lines=28) @@
2997
2998
        return self._send_xml_command(cmd)
2999
3000
    def get_report_format(
3001
        self, report_format_id: Union[str, ReportFormatType]
3002
    ) -> Any:
3003
        """Request a single report format
3004
3005
        Arguments:
3006
            report_format_id: UUID of an existing report format
3007
                              or ReportFormatType (enum)
3008
3009
        Returns:
3010
            The response. See :py:meth:`send_command` for details.
3011
        """
3012
        cmd = XmlCommand("get_report_formats")
3013
3014
        if not report_format_id:
3015
            raise RequiredArgument(
3016
                function=self.get_report_format.__name__,
3017
                argument='report_format_id',
3018
            )
3019
3020
        if isinstance(report_format_id, ReportFormatType):
3021
            report_format_id = report_format_id.value
3022
3023
        cmd.set_attribute("report_format_id", report_format_id)
3024
3025
        # for single entity always request all details
3026
        cmd.set_attribute("details", "1")
3027
        return self._send_xml_command(cmd)
3028
3029
    def get_roles(
3030
        self,