def cli(env, identifier, out_file):
    """Prints out an SSH key to the screen."""

    mgr = SoftLayer.SshKeyManager(env.client)

    key_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'SshKey')

    key = mgr.get_key(key_id)

    if out_file:
        with open(path.expanduser(out_file), 'w') as pub_file:
            pub_file.write(key['key'])

    table = formatting.KeyValueTable(['name', 'value'])
    table.add_row(['id', key['id']])
    table.add_row(['label', key.get('label')])
    table.add_row(['notes', key.get('notes', '-')])
    env.fout(table)
def cli ( env , identifier , out_file ) : mgr = SoftLayer . SshKeyManager ( env . client ) key_id = helpers . resolve_id ( mgr . resolve_ids , identifier , 'SshKey' ) key = mgr . get_key ( key_id ) if out_file : with open ( path . expanduser ( out_file ) , 'w' ) as pub_file : pub_file . write ( key [ 'key' ] ) table = formatting . KeyValueTable ( [ 'name' , 'value' ] ) table . add_row ( [ 'id' , key [ 'id' ] ] ) table . add_row ( [ 'label' , key . get ( 'label' ) ] ) table . add_row ( [ 'notes' , key . get ( 'notes' , '-' ) ] ) env . fout ( table )
Prints out an SSH key to the screen.