Constructor Details

# File 'lib/virt/connection.rb', line 6definitializeuri,options={}raise("Must provide a host to connect to")unlessuriifuri=~/^(esx|vpx)/raise("Must provide a username and password")unlessoptions[:username]oroptions[:password]@connection=Libvirt::open_auth(uri,[Libvirt::CRED_AUTHNAME,Libvirt::CRED_PASSPHRASE])do|cred|# This may only be required for ESXi connections, not sure.@type="VMWare"casecred['type']when::Libvirt::CRED_AUTHNAMEoptions[:username]when::Libvirt::CRED_PASSPHRASEoptions[:password]endendelse@type="KVM"@connection=Libvirt::openuriendend