Beispiel #1
0
    def password_clear(self, name):
        # type: (str) -> None
        """Clear password

        :param name: name of the password
        :type name: string
        """
        password_name_string = u._('Password name')
        check_arg(name, password_name_string, str)
        disallow_chars(name, password_name_string, '\'')
        clear_password(name)
Beispiel #2
0
    def password_set(self, name, value):
        # type: (str, str) -> None
        """Set password

        :param name: name of the password
        :type name: string
        :param value: value of the password
        :type value: string
        """
        password_name_string = u._('Password name')
        password_value_string = u._('Password value')
        check_arg(name, password_name_string, str)
        disallow_chars(name, password_name_string, '\'')
        check_arg(value,
                  password_value_string,
                  str,
                  display_param=False,
                  empty_ok=True,
                  none_ok=True)
        disallow_chars(value, password_value_string, '\'')
        set_password(name, value)
Beispiel #3
0
    def password_set_sshkey(self, name, private_key, public_key):
        # type: (str, str, str) -> None
        """Set password to an ssh key

        :param name: name of the password
        :type name: string
        :param private_key: ssh private key
        :type value: string
        :param public_key: ssh public key
        :type value: string
        """
        password_name_string = u._('Password name')
        private_key_string = u._('Private key')
        public_key_string = u._('Public key')
        check_arg(name, password_name_string, str)
        disallow_chars(name, password_name_string, '\'')
        check_arg(private_key, private_key_string, str, display_param=False)
        disallow_chars(private_key, private_key_string, '\'')
        check_arg(public_key, public_key_string, str, display_param=False)
        disallow_chars(public_key, public_key_string, '\'')
        set_password_sshkey(name, private_key, public_key)