Code Duplication    Length = 22-22 lines in 2 locations

gvm/protocols/gmpv7/gmpv7.py 1 location

@@ 2848-2869 (lines=22) @@
2845
2846
        return self._send_xml_command(cmd)
2847
2848
    def get_alert(self, alert_id: str, *, tasks: Optional[bool] = None) -> Any:
2849
        """Request a single alert
2850
2851
        Arguments:
2852
            alert_id: UUID of an existing alert
2853
2854
        Returns:
2855
            The response. See :py:meth:`send_command` for details.
2856
        """
2857
        cmd = XmlCommand("get_alerts")
2858
2859
        if not alert_id:
2860
            raise RequiredArgument(
2861
                function=self.get_alert.__name__, argument='alert_id'
2862
            )
2863
2864
        cmd.set_attribute("alert_id", alert_id)
2865
2866
        if tasks is not None:
2867
            cmd.set_attribute("tasks", _to_bool(tasks))
2868
2869
        return self._send_xml_command(cmd)
2870
2871
    def get_assets(
2872
        self,

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 4705-4726 (lines=22) @@
4702
4703
        return self._send_xml_command(cmd)
4704
4705
    def get_alert(self, alert_id: str, *, tasks: Optional[bool] = None) -> Any:
4706
        """Request a single alert
4707
4708
        Arguments:
4709
            alert_id: UUID of an existing alert
4710
4711
        Returns:
4712
            The response. See :py:meth:`send_command` for details.
4713
        """
4714
        cmd = XmlCommand("get_alerts")
4715
4716
        if not alert_id:
4717
            raise RequiredArgument(
4718
                function=self.get_alert.__name__, argument='alert_id'
4719
            )
4720
4721
        cmd.set_attribute("alert_id", alert_id)
4722
4723
        if tasks is not None:
4724
            cmd.set_attribute("tasks", _to_bool(tasks))
4725
4726
        return self._send_xml_command(cmd)
4727
4728
    def get_assets(
4729
        self,