Code Duplication    Length = 20-20 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 5977-5996 (lines=20) @@
5974
5975
        return self._send_xml_command(cmd)
5976
5977
    def modify_asset(self, asset_id: str, comment: Optional[str] = "") -> Any:
5978
        """Modifies an existing asset.
5979
5980
        Arguments:
5981
            asset_id: UUID of the asset to be modified.
5982
            comment: Comment for the asset.
5983
5984
        Returns:
5985
            The response. See :py:meth:`send_command` for details.
5986
        """
5987
        if not asset_id:
5988
            raise RequiredArgument(
5989
                function=self.modify_asset.__name__, argument='asset_id'
5990
            )
5991
5992
        cmd = XmlCommand("modify_asset")
5993
        cmd.set_attribute("asset_id", asset_id)
5994
        cmd.add_element("comment", comment)
5995
5996
        return self._send_xml_command(cmd)
5997
5998
    def modify_auth(self, group_name: str, auth_conf_settings: dict) -> Any:
5999
        """Modifies an existing auth.

gvm/protocols/gmpv7/gmpv7.py 1 location

@@ 4543-4562 (lines=20) @@
4540
4541
        return self._send_xml_command(cmd)
4542
4543
    def modify_asset(self, asset_id: str, comment: Optional[str] = "") -> Any:
4544
        """Modifies an existing asset.
4545
4546
        Arguments:
4547
            asset_id: UUID of the asset to be modified.
4548
            comment: Comment for the asset.
4549
4550
        Returns:
4551
            The response. See :py:meth:`send_command` for details.
4552
        """
4553
        if not asset_id:
4554
            raise RequiredArgument(
4555
                function=self.modify_asset.__name__, argument='asset_id'
4556
            )
4557
4558
        cmd = XmlCommand("modify_asset")
4559
        cmd.set_attribute("asset_id", asset_id)
4560
        cmd.add_element("comment", comment)
4561
4562
        return self._send_xml_command(cmd)
4563
4564
    def modify_auth(self, group_name: str, auth_conf_settings: dict) -> Any:
4565
        """Modifies an existing auth.