Code Duplication    Length = 28-28 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 5998-6025 (lines=28) @@
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.
6000
6001
        Arguments:
6002
            group_name: Name of the group to be modified.
6003
            auth_conf_settings: The new auth config.
6004
6005
        Returns:
6006
            The response. See :py:meth:`send_command` for details.
6007
        """
6008
        if not group_name:
6009
            raise RequiredArgument(
6010
                function=self.modify_auth.__name__, argument='group_name'
6011
            )
6012
        if not auth_conf_settings:
6013
            raise RequiredArgument(
6014
                function=self.modify_auth.__name__,
6015
                argument='auth_conf_settings',
6016
            )
6017
        cmd = XmlCommand("modify_auth")
6018
        _xmlgroup = cmd.add_element("group", attrs={"name": str(group_name)})
6019
6020
        for key, value in auth_conf_settings.items():
6021
            _xmlauthconf = _xmlgroup.add_element("auth_conf_setting")
6022
            _xmlauthconf.add_element("key", key)
6023
            _xmlauthconf.add_element("value", value)
6024
6025
        return self._send_xml_command(cmd)
6026
6027
    def modify_config_set_nvt_preference(
6028
        self,

gvm/protocols/gmpv7/gmpv7.py 1 location

@@ 4564-4591 (lines=28) @@
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.
4566
4567
        Arguments:
4568
            group_name: Name of the group to be modified.
4569
            auth_conf_settings: The new auth config.
4570
4571
        Returns:
4572
            The response. See :py:meth:`send_command` for details.
4573
        """
4574
        if not group_name:
4575
            raise RequiredArgument(
4576
                function=self.modify_auth.__name__, argument='group_name'
4577
            )
4578
        if not auth_conf_settings:
4579
            raise RequiredArgument(
4580
                function=self.modify_auth.__name__,
4581
                argument='auth_conf_settings',
4582
            )
4583
        cmd = XmlCommand("modify_auth")
4584
        _xmlgroup = cmd.add_element("group", attrs={"name": str(group_name)})
4585
4586
        for key, value in auth_conf_settings.items():
4587
            _xmlauthconf = _xmlgroup.add_element("auth_conf_setting")
4588
            _xmlauthconf.add_element("key", key)
4589
            _xmlauthconf.add_element("value", value)
4590
4591
        return self._send_xml_command(cmd)
4592
4593
    def modify_config_set_nvt_preference(
4594
        self,