# File lib/fog/libvirt/compute.rb, line 80
        def initialize(options={})
          @uri = ::Fog::Compute::LibvirtUtil::URI.new(enhance_uri(options[:libvirt_uri]))
          @ip_command = options[:libvirt_ip_command]

          # libvirt is part of the gem => ruby-libvirt
          require 'libvirt'

          begin
            if options[:libvirt_username] and options[:libvirt_password]
              @client = ::Libvirt::open_auth(uri.uri, [::Libvirt::CRED_AUTHNAME, ::Libvirt::CRED_PASSPHRASE]) do |cred|
                case cred['type']
                  when ::Libvirt::CRED_AUTHNAME
                    options[:libvirt_username]
                  when ::Libvirt::CRED_PASSPHRASE
                    options[:libvirt_password]
                end
              end
            else
              @client = ::Libvirt::open(uri.uri)
            end

          rescue ::Libvirt::ConnectionError
            raise Fog::Errors::Error.new("Error making a connection to libvirt URI #{uri.uri}:\n#{$!}")
          end

        end