use std::env;
#[cfg(feature = "compute")]
#[tokio::main(flavor = "current_thread")]
async fn main() {
env_logger::init();
let os = openstack::Cloud::from_env()
.await
.expect("Failed to create an identity provider from the environment");
let id = env::args().nth(1).expect("Provide a key pair name");
let keypair = os.get_keypair(id).await.expect("Cannot get a key pair");
println!(
"Fingerprint = {}, type = {:?}",
keypair.fingerprint(),
keypair.key_type()
);
}
#[cfg(not(feature = "compute"))]
fn main() {
panic!("This example cannot run with 'compute' feature disabled");
}