def generate_public_rsa_key_file(private_key, ssh_path, key_base_name):
    """
        Generate a default PUBLIC SSH key file using RSA
    """
    try:
        username = os.getlogin()
    except AttributeError:
        username = os.getenv('USERNAME', 'cloudControl')

    try:
        hostname = os.uname()[1]
    except __HOLE__:
        hostname = os.getenv('COMPUTERNAME', 'localhost')

    # Create the content of the public key as string
    pubkey_string = 'ssh-rsa {0} {1}@{2} \n'.format(
        private_key.get_base64(),
        username,
        hostname)

    # Write the public key to file system
    public_key_filename = ssh_path + "/" + key_base_name + ".pub"
    pubkey = open(public_key_filename, 'w')
    pubkey.write(pubkey_string)
    pubkey.close()

    return True
dataset/ETHPy150Open cloudControl/cctrl/cctrl/keyhelpers.py/generate_public_rsa_key_file