def METHOD_NAME(
    nodeip: str, uname: str, pword: str, directory: str, results: list
) -> None:
    """Generate sosreport in the given node and copy report to directory provided
    Args:
       nodeip              host Ip address
       uname               Username for accessing host
       pword               password for accessing host through given user
       directory           directory to store all the logs
       results             host IP address for which this operation are failed
    Returns:
        None
    """
    print(f"Connecting {nodeip} to generate sosreport")
    try:
        ssh_d = paramiko.SSHClient()
        ssh_d.set_missing_host_key_policy(paramiko.AutoAddPolicy())
        ssh_d.connect(nodeip, username=uname, password=pword)
        ssh_d.exec_command("sudo yum -y install sos")
        stdin, stdout, stderr = ssh_d.exec_command(
            "sudo sosreport -a --all-logs -e ceph --batch"
        )
        rc = stdout.channel.recv_exit_status()
        sosreport = re.search(r"sosreport-.*.tar.xz", stdout.read().decode())
        if rc and not sosreport:
            print(f"Failed to generate sosreport {nodeip}")
            results.append(nodeip)
            return
        source_file = f"/var/tmp/{sosreport.group()}"
        ssh_d.exec_command(f"sudo chown {uname} {source_file}")
        directory_path = os.path.join(directory, "sosreports")
        dir_exist = os.path.exists(directory_path)
        if not dir_exist:
            os.makedirs(directory_path)
        ftp_client = ssh_d.open_sftp()
        ftp_client.get(f"{source_file}", f"{directory_path}/{sosreport.group()}")
        ftp_client.close()
        print(
            f"Successfully generated sosreport for node {nodeip} :{sosreport.group()}"
        )
        ssh_d.exec_command(f"sudo rm -rf {source_file}")
        ssh_d.close()
    except Exception:
        results.append(nodeip)