Module: VagrantPlugins::ProviderLibvirt

Defined in:
lib/vagrant-libvirt.rb,
lib/vagrant-libvirt/util.rb,
lib/vagrant-libvirt/action.rb,
lib/vagrant-libvirt/config.rb,
lib/vagrant-libvirt/driver.rb,
lib/vagrant-libvirt/errors.rb,
lib/vagrant-libvirt/plugin.rb,
lib/vagrant-libvirt/util/ui.rb,
lib/vagrant-libvirt/version.rb,
lib/vagrant-libvirt/provider.rb,
lib/vagrant-libvirt/util/nfs.rb,
lib/vagrant-libvirt/util/timer.rb,
lib/vagrant-libvirt/cap/mount_p9.rb,
lib/vagrant-libvirt/util/collection.rb,
lib/vagrant-libvirt/util/error_codes.rb,
lib/vagrant-libvirt/action/is_created.rb,
lib/vagrant-libvirt/action/is_running.rb,
lib/vagrant-libvirt/util/erb_template.rb,
lib/vagrant-libvirt/util/network_util.rb,
lib/vagrant-libvirt/util/storage_util.rb,
lib/vagrant-libvirt/action/halt_domain.rb,
lib/vagrant-libvirt/cap/public_address.rb,
lib/vagrant-libvirt/action/is_suspended.rb,
lib/vagrant-libvirt/action/start_domain.rb,
lib/vagrant-libvirt/action/wait_till_up.rb,
lib/vagrant-libvirt/action/create_domain.rb,
lib/vagrant-libvirt/action/forward_ports.rb,
lib/vagrant-libvirt/action/forward_ports.rb,
lib/vagrant-libvirt/action/resume_domain.rb,
lib/vagrant-libvirt/action/share_folders.rb,
lib/vagrant-libvirt/action/destroy_domain.rb,
lib/vagrant-libvirt/action/package_domain.rb,
lib/vagrant-libvirt/action/set_boot_order.rb,
lib/vagrant-libvirt/action/suspend_domain.rb,
lib/vagrant-libvirt/cap/nic_mac_addresses.rb,
lib/vagrant-libvirt/action/create_networks.rb,
lib/vagrant-libvirt/action/destroy_networks.rb,
lib/vagrant-libvirt/action/handle_box_image.rb,
lib/vagrant-libvirt/action/prune_nfs_exports.rb,
lib/vagrant-libvirt/action/read_mac_addresses.rb,
lib/vagrant-libvirt/action/set_name_of_domain.rb,
lib/vagrant-libvirt/action/handle_storage_pool.rb,
lib/vagrant-libvirt/action/message_not_created.rb,
lib/vagrant-libvirt/action/message_not_running.rb,
lib/vagrant-libvirt/action/remove_stale_volume.rb,
lib/vagrant-libvirt/action/create_domain_volume.rb,
lib/vagrant-libvirt/action/prepare_nfs_settings.rb,
lib/vagrant-libvirt/action/remove_libvirt_image.rb,
lib/vagrant-libvirt/action/message_not_suspended.rb,
lib/vagrant-libvirt/action/prepare_nfs_valid_ids.rb,
lib/vagrant-libvirt/action/message_already_created.rb,
lib/vagrant-libvirt/action/message_will_not_destroy.rb,
lib/vagrant-libvirt/action/create_network_interfaces.rb

Defined Under Namespace

Modules: Action, Cap, Errors, Util Classes: Config, Driver, Plugin, Provider

Constant Summary collapse

VERSION_FILE =
File.dirname(__FILE__) + "/version"

Class Method Summary collapse

Class Method Details

.get_versionObject


5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/vagrant-libvirt/version.rb', line 5

def self.get_version
  if File.exist?(VERSION_FILE)
    version = File.read(VERSION_FILE)
  else
    git_version = `git describe --tags`
    version_parts = git_version.split('-').first(2) # drop the git sha if it exists
    if version_parts.length > 1
      # increment the patch number so that this is marked as a pre-release of the
      # next possible release
      main_version_parts = Gem::Version.new(version_parts[0]).segments
      main_version_parts[-1] = main_version_parts.last + 1
      version_parts = main_version_parts + ["pre", version_parts[1]]
    end
    version = version_parts.join(".")
  end

  return version.freeze
end

.source_rootObject


10
11
12
# File 'lib/vagrant-libvirt.rb', line 10

def self.source_root
  @source_root ||= Pathname.new(File.expand_path('../../', __FILE__))
end

.write_versionObject


24
25
26
# File 'lib/vagrant-libvirt/version.rb', line 24

def self.write_version
  File.write(VERSION_FILE, self.get_version)
end