vagrant-lxc 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +14 -6
- data/Gemfile +19 -14
- data/Gemfile.lock +10 -5
- data/README.md +18 -42
- data/development/Vagrantfile.1.0 +3 -2
- data/lib/vagrant-lxc/version.rb +1 -1
- data/lib/vagrant-lxc.rb +0 -2
- data/vagrant-lxc.gemspec +1 -14
- metadata +7 -540
- data/.gitmodules +0 -3
- data/bin/vagrant-lxc +0 -9
- data/lib/vendored_vagrant.rb +0 -9
- data/vendor/.gitkeep +0 -0
- data/vendor/vagrant/.gitignore +0 -31
- data/vendor/vagrant/.travis.yml +0 -7
- data/vendor/vagrant/.yardopts +0 -1
- data/vendor/vagrant/CHANGELOG.md +0 -803
- data/vendor/vagrant/Gemfile +0 -3
- data/vendor/vagrant/LICENSE +0 -21
- data/vendor/vagrant/README.md +0 -89
- data/vendor/vagrant/Rakefile +0 -18
- data/vendor/vagrant/bin/vagrant +0 -84
- data/vendor/vagrant/config/default.rb +0 -35
- data/vendor/vagrant/contrib/README.md +0 -12
- data/vendor/vagrant/contrib/bash/completion.sh +0 -3
- data/vendor/vagrant/contrib/emacs/vagrant.el +0 -8
- data/vendor/vagrant/contrib/vim/vagrantfile.vim +0 -9
- data/vendor/vagrant/keys/README.md +0 -17
- data/vendor/vagrant/keys/vagrant +0 -27
- data/vendor/vagrant/keys/vagrant.pub +0 -1
- data/vendor/vagrant/lib/vagrant/action/builder.rb +0 -154
- data/vendor/vagrant/lib/vagrant/action/builtin/box_add.rb +0 -79
- data/vendor/vagrant/lib/vagrant/action/builtin/call.rb +0 -67
- data/vendor/vagrant/lib/vagrant/action/builtin/config_validate.rb +0 -30
- data/vendor/vagrant/lib/vagrant/action/builtin/confirm.rb +0 -38
- data/vendor/vagrant/lib/vagrant/action/builtin/env_set.rb +0 -24
- data/vendor/vagrant/lib/vagrant/action/builtin/graceful_halt.rb +0 -73
- data/vendor/vagrant/lib/vagrant/action/builtin/handle_box_url.rb +0 -43
- data/vendor/vagrant/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb +0 -117
- data/vendor/vagrant/lib/vagrant/action/builtin/lock.rb +0 -57
- data/vendor/vagrant/lib/vagrant/action/builtin/nfs.rb +0 -117
- data/vendor/vagrant/lib/vagrant/action/builtin/provision.rb +0 -70
- data/vendor/vagrant/lib/vagrant/action/builtin/set_hostname.rb +0 -27
- data/vendor/vagrant/lib/vagrant/action/builtin/ssh_exec.rb +0 -42
- data/vendor/vagrant/lib/vagrant/action/builtin/ssh_run.rb +0 -43
- data/vendor/vagrant/lib/vagrant/action/general/package.rb +0 -102
- data/vendor/vagrant/lib/vagrant/action/hook.rb +0 -103
- data/vendor/vagrant/lib/vagrant/action/runner.rb +0 -69
- data/vendor/vagrant/lib/vagrant/action/warden.rb +0 -103
- data/vendor/vagrant/lib/vagrant/action.rb +0 -42
- data/vendor/vagrant/lib/vagrant/box.rb +0 -93
- data/vendor/vagrant/lib/vagrant/box_collection.rb +0 -315
- data/vendor/vagrant/lib/vagrant/cli.rb +0 -82
- data/vendor/vagrant/lib/vagrant/config/container.rb +0 -37
- data/vendor/vagrant/lib/vagrant/config/loader.rb +0 -222
- data/vendor/vagrant/lib/vagrant/config/v1/dummy_config.rb +0 -13
- data/vendor/vagrant/lib/vagrant/config/v1/loader.rb +0 -105
- data/vendor/vagrant/lib/vagrant/config/v1/root.rb +0 -60
- data/vendor/vagrant/lib/vagrant/config/v1.rb +0 -9
- data/vendor/vagrant/lib/vagrant/config/v2/dummy_config.rb +0 -13
- data/vendor/vagrant/lib/vagrant/config/v2/loader.rb +0 -141
- data/vendor/vagrant/lib/vagrant/config/v2/root.rb +0 -105
- data/vendor/vagrant/lib/vagrant/config/v2/util.rb +0 -21
- data/vendor/vagrant/lib/vagrant/config/v2.rb +0 -9
- data/vendor/vagrant/lib/vagrant/config/version_base.rb +0 -80
- data/vendor/vagrant/lib/vagrant/config.rb +0 -63
- data/vendor/vagrant/lib/vagrant/downloaders/base.rb +0 -22
- data/vendor/vagrant/lib/vagrant/downloaders/file.rb +0 -28
- data/vendor/vagrant/lib/vagrant/downloaders/http.rb +0 -116
- data/vendor/vagrant/lib/vagrant/downloaders.rb +0 -7
- data/vendor/vagrant/lib/vagrant/environment.rb +0 -729
- data/vendor/vagrant/lib/vagrant/errors.rb +0 -486
- data/vendor/vagrant/lib/vagrant/hosts.rb +0 -28
- data/vendor/vagrant/lib/vagrant/machine.rb +0 -325
- data/vendor/vagrant/lib/vagrant/machine_state.rb +0 -45
- data/vendor/vagrant/lib/vagrant/plugin/v1/command.rb +0 -169
- data/vendor/vagrant/lib/vagrant/plugin/v1/communicator.rb +0 -98
- data/vendor/vagrant/lib/vagrant/plugin/v1/config.rb +0 -112
- data/vendor/vagrant/lib/vagrant/plugin/v1/errors.rb +0 -15
- data/vendor/vagrant/lib/vagrant/plugin/v1/guest.rb +0 -92
- data/vendor/vagrant/lib/vagrant/plugin/v1/host.rb +0 -66
- data/vendor/vagrant/lib/vagrant/plugin/v1/manager.rb +0 -131
- data/vendor/vagrant/lib/vagrant/plugin/v1/plugin.rb +0 -229
- data/vendor/vagrant/lib/vagrant/plugin/v1/provider.rb +0 -68
- data/vendor/vagrant/lib/vagrant/plugin/v1/provisioner.rb +0 -50
- data/vendor/vagrant/lib/vagrant/plugin/v1.rb +0 -19
- data/vendor/vagrant/lib/vagrant/plugin/v2/command.rb +0 -234
- data/vendor/vagrant/lib/vagrant/plugin/v2/communicator.rb +0 -98
- data/vendor/vagrant/lib/vagrant/plugin/v2/components.rb +0 -29
- data/vendor/vagrant/lib/vagrant/plugin/v2/config.rb +0 -101
- data/vendor/vagrant/lib/vagrant/plugin/v2/errors.rb +0 -15
- data/vendor/vagrant/lib/vagrant/plugin/v2/guest.rb +0 -92
- data/vendor/vagrant/lib/vagrant/plugin/v2/host.rb +0 -66
- data/vendor/vagrant/lib/vagrant/plugin/v2/manager.rb +0 -158
- data/vendor/vagrant/lib/vagrant/plugin/v2/plugin.rb +0 -217
- data/vendor/vagrant/lib/vagrant/plugin/v2/provider.rb +0 -69
- data/vendor/vagrant/lib/vagrant/plugin/v2/provisioner.rb +0 -47
- data/vendor/vagrant/lib/vagrant/plugin/v2.rb +0 -22
- data/vendor/vagrant/lib/vagrant/plugin.rb +0 -6
- data/vendor/vagrant/lib/vagrant/registry.rb +0 -78
- data/vendor/vagrant/lib/vagrant/ssh.rb +0 -132
- data/vendor/vagrant/lib/vagrant/test_helpers.rb +0 -154
- data/vendor/vagrant/lib/vagrant/ui.rb +0 -170
- data/vendor/vagrant/lib/vagrant/util/ansi_escape_code_remover.rb +0 -34
- data/vendor/vagrant/lib/vagrant/util/busy.rb +0 -59
- data/vendor/vagrant/lib/vagrant/util/counter.rb +0 -24
- data/vendor/vagrant/lib/vagrant/util/file_checksum.rb +0 -38
- data/vendor/vagrant/lib/vagrant/util/file_mode.rb +0 -12
- data/vendor/vagrant/lib/vagrant/util/hash_with_indifferent_access.rb +0 -63
- data/vendor/vagrant/lib/vagrant/util/is_port_open.rb +0 -38
- data/vendor/vagrant/lib/vagrant/util/line_ending_helpers.rb +0 -14
- data/vendor/vagrant/lib/vagrant/util/network_ip.rb +0 -28
- data/vendor/vagrant/lib/vagrant/util/platform.rb +0 -68
- data/vendor/vagrant/lib/vagrant/util/retryable.rb +0 -31
- data/vendor/vagrant/lib/vagrant/util/safe_exec.rb +0 -36
- data/vendor/vagrant/lib/vagrant/util/safe_puts.rb +0 -31
- data/vendor/vagrant/lib/vagrant/util/scoped_hash_override.rb +0 -45
- data/vendor/vagrant/lib/vagrant/util/ssh.rb +0 -126
- data/vendor/vagrant/lib/vagrant/util/stacked_proc_runner.rb +0 -35
- data/vendor/vagrant/lib/vagrant/util/string_block_editor.rb +0 -75
- data/vendor/vagrant/lib/vagrant/util/subprocess.rb +0 -270
- data/vendor/vagrant/lib/vagrant/util/template_renderer.rb +0 -83
- data/vendor/vagrant/lib/vagrant/util/which.rb +0 -43
- data/vendor/vagrant/lib/vagrant/util.rb +0 -12
- data/vendor/vagrant/lib/vagrant/version.rb +0 -6
- data/vendor/vagrant/lib/vagrant.rb +0 -251
- data/vendor/vagrant/plugins/README.md +0 -5
- data/vendor/vagrant/plugins/commands/box/command/add.rb +0 -52
- data/vendor/vagrant/plugins/commands/box/command/list.rb +0 -41
- data/vendor/vagrant/plugins/commands/box/command/remove.rb +0 -37
- data/vendor/vagrant/plugins/commands/box/command/repackage.rb +0 -43
- data/vendor/vagrant/plugins/commands/box/command/root.rb +0 -75
- data/vendor/vagrant/plugins/commands/box/plugin.rb +0 -15
- data/vendor/vagrant/plugins/commands/destroy/command.rb +0 -31
- data/vendor/vagrant/plugins/commands/destroy/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/halt/command.rb +0 -33
- data/vendor/vagrant/plugins/commands/halt/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/init/command.rb +0 -40
- data/vendor/vagrant/plugins/commands/init/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/package/command.rb +0 -78
- data/vendor/vagrant/plugins/commands/package/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/plugin/action/bundler_check.rb +0 -25
- data/vendor/vagrant/plugins/commands/plugin/action/install_gem.rb +0 -70
- data/vendor/vagrant/plugins/commands/plugin/action/license_plugin.rb +0 -54
- data/vendor/vagrant/plugins/commands/plugin/action/list_plugins.rb +0 -54
- data/vendor/vagrant/plugins/commands/plugin/action/prune_gems.rb +0 -149
- data/vendor/vagrant/plugins/commands/plugin/action/uninstall_plugin.rb +0 -23
- data/vendor/vagrant/plugins/commands/plugin/action.rb +0 -52
- data/vendor/vagrant/plugins/commands/plugin/command/base.rb +0 -22
- data/vendor/vagrant/plugins/commands/plugin/command/install.rb +0 -39
- data/vendor/vagrant/plugins/commands/plugin/command/license.rb +0 -31
- data/vendor/vagrant/plugins/commands/plugin/command/list.rb +0 -28
- data/vendor/vagrant/plugins/commands/plugin/command/root.rb +0 -75
- data/vendor/vagrant/plugins/commands/plugin/command/uninstall.rb +0 -28
- data/vendor/vagrant/plugins/commands/plugin/gem_helper.rb +0 -74
- data/vendor/vagrant/plugins/commands/plugin/plugin.rb +0 -22
- data/vendor/vagrant/plugins/commands/plugin/state_file.rb +0 -57
- data/vendor/vagrant/plugins/commands/provision/command.rb +0 -34
- data/vendor/vagrant/plugins/commands/provision/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/reload/command.rb +0 -37
- data/vendor/vagrant/plugins/commands/reload/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/resume/command.rb +0 -25
- data/vendor/vagrant/plugins/commands/resume/plugin.rb +0 -17
- data/vendor/vagrant/plugins/commands/ssh/command.rb +0 -66
- data/vendor/vagrant/plugins/commands/ssh/plugin.rb +0 -17
- data/vendor/vagrant/plugins/commands/ssh_config/command.rb +0 -49
- data/vendor/vagrant/plugins/commands/ssh_config/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/status/command.rb +0 -39
- data/vendor/vagrant/plugins/commands/status/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/suspend/command.rb +0 -25
- data/vendor/vagrant/plugins/commands/suspend/plugin.rb +0 -18
- data/vendor/vagrant/plugins/commands/up/command.rb +0 -45
- data/vendor/vagrant/plugins/commands/up/plugin.rb +0 -17
- data/vendor/vagrant/plugins/commands/up/start_mixins.rb +0 -26
- data/vendor/vagrant/plugins/communicators/ssh/communicator.rb +0 -317
- data/vendor/vagrant/plugins/communicators/ssh/plugin.rb +0 -19
- data/vendor/vagrant/plugins/guests/arch/guest.rb +0 -41
- data/vendor/vagrant/plugins/guests/arch/plugin.rb +0 -15
- data/vendor/vagrant/plugins/guests/debian/guest.rb +0 -72
- data/vendor/vagrant/plugins/guests/debian/plugin.rb +0 -15
- data/vendor/vagrant/plugins/guests/fedora/guest.rb +0 -71
- data/vendor/vagrant/plugins/guests/fedora/plugin.rb +0 -15
- data/vendor/vagrant/plugins/guests/freebsd/config.rb +0 -13
- data/vendor/vagrant/plugins/guests/freebsd/guest.rb +0 -70
- data/vendor/vagrant/plugins/guests/freebsd/plugin.rb +0 -20
- data/vendor/vagrant/plugins/guests/gentoo/guest.rb +0 -51
- data/vendor/vagrant/plugins/guests/gentoo/plugin.rb +0 -15
- data/vendor/vagrant/plugins/guests/linux/config.rb +0 -13
- data/vendor/vagrant/plugins/guests/linux/guest.rb +0 -118
- data/vendor/vagrant/plugins/guests/linux/plugin.rb +0 -20
- data/vendor/vagrant/plugins/guests/openbsd/guest.rb +0 -13
- data/vendor/vagrant/plugins/guests/openbsd/plugin.rb +0 -15
- data/vendor/vagrant/plugins/guests/redhat/guest.rb +0 -74
- data/vendor/vagrant/plugins/guests/redhat/plugin.rb +0 -15
- data/vendor/vagrant/plugins/guests/solaris/config.rb +0 -18
- data/vendor/vagrant/plugins/guests/solaris/guest.rb +0 -73
- data/vendor/vagrant/plugins/guests/solaris/plugin.rb +0 -20
- data/vendor/vagrant/plugins/guests/suse/guest.rb +0 -24
- data/vendor/vagrant/plugins/guests/suse/plugin.rb +0 -15
- data/vendor/vagrant/plugins/guests/ubuntu/guest.rb +0 -44
- data/vendor/vagrant/plugins/guests/ubuntu/plugin.rb +0 -15
- data/vendor/vagrant/plugins/hosts/arch/host.rb +0 -68
- data/vendor/vagrant/plugins/hosts/arch/plugin.rb +0 -15
- data/vendor/vagrant/plugins/hosts/bsd/host.rb +0 -102
- data/vendor/vagrant/plugins/hosts/bsd/plugin.rb +0 -15
- data/vendor/vagrant/plugins/hosts/fedora/host.rb +0 -51
- data/vendor/vagrant/plugins/hosts/fedora/plugin.rb +0 -15
- data/vendor/vagrant/plugins/hosts/freebsd/host.rb +0 -43
- data/vendor/vagrant/plugins/hosts/freebsd/plugin.rb +0 -15
- data/vendor/vagrant/plugins/hosts/gentoo/host.rb +0 -24
- data/vendor/vagrant/plugins/hosts/gentoo/plugin.rb +0 -15
- data/vendor/vagrant/plugins/hosts/linux/host.rb +0 -95
- data/vendor/vagrant/plugins/hosts/linux/plugin.rb +0 -15
- data/vendor/vagrant/plugins/hosts/opensuse/host.rb +0 -34
- data/vendor/vagrant/plugins/hosts/opensuse/plugin.rb +0 -15
- data/vendor/vagrant/plugins/hosts/windows/host.rb +0 -17
- data/vendor/vagrant/plugins/hosts/windows/plugin.rb +0 -15
- data/vendor/vagrant/plugins/kernel_v1/config/nfs.rb +0 -20
- data/vendor/vagrant/plugins/kernel_v1/config/package.rb +0 -17
- data/vendor/vagrant/plugins/kernel_v1/config/ssh.rb +0 -46
- data/vendor/vagrant/plugins/kernel_v1/config/vagrant.rb +0 -31
- data/vendor/vagrant/plugins/kernel_v1/config/vm.rb +0 -184
- data/vendor/vagrant/plugins/kernel_v1/plugin.rb +0 -44
- data/vendor/vagrant/plugins/kernel_v2/config/nfs.rb +0 -10
- data/vendor/vagrant/plugins/kernel_v2/config/package.rb +0 -9
- data/vendor/vagrant/plugins/kernel_v2/config/ssh.rb +0 -35
- data/vendor/vagrant/plugins/kernel_v2/config/vagrant.rb +0 -9
- data/vendor/vagrant/plugins/kernel_v2/config/vm.rb +0 -314
- data/vendor/vagrant/plugins/kernel_v2/config/vm_provisioner.rb +0 -40
- data/vendor/vagrant/plugins/kernel_v2/config/vm_subvm.rb +0 -30
- data/vendor/vagrant/plugins/kernel_v2/plugin.rb +0 -44
- data/vendor/vagrant/plugins/providers/virtualbox/action/boot.rb +0 -49
- data/vendor/vagrant/plugins/providers/virtualbox/action/check_accessible.rb +0 -23
- data/vendor/vagrant/plugins/providers/virtualbox/action/check_created.rb +0 -21
- data/vendor/vagrant/plugins/providers/virtualbox/action/check_guest_additions.rb +0 -45
- data/vendor/vagrant/plugins/providers/virtualbox/action/check_running.rb +0 -21
- data/vendor/vagrant/plugins/providers/virtualbox/action/check_virtualbox.rb +0 -22
- data/vendor/vagrant/plugins/providers/virtualbox/action/clean_machine_folder.rb +0 -43
- data/vendor/vagrant/plugins/providers/virtualbox/action/clear_forwarded_ports.rb +0 -18
- data/vendor/vagrant/plugins/providers/virtualbox/action/clear_network_interfaces.rb +0 -31
- data/vendor/vagrant/plugins/providers/virtualbox/action/clear_shared_folders.rb +0 -17
- data/vendor/vagrant/plugins/providers/virtualbox/action/created.rb +0 -20
- data/vendor/vagrant/plugins/providers/virtualbox/action/customize.rb +0 -36
- data/vendor/vagrant/plugins/providers/virtualbox/action/destroy.rb +0 -19
- data/vendor/vagrant/plugins/providers/virtualbox/action/destroy_confirm.rb +0 -17
- data/vendor/vagrant/plugins/providers/virtualbox/action/destroy_unused_network_interfaces.rb +0 -16
- data/vendor/vagrant/plugins/providers/virtualbox/action/discard_state.rb +0 -20
- data/vendor/vagrant/plugins/providers/virtualbox/action/export.rb +0 -57
- data/vendor/vagrant/plugins/providers/virtualbox/action/forced_halt.rb +0 -25
- data/vendor/vagrant/plugins/providers/virtualbox/action/forward_ports.rb +0 -79
- data/vendor/vagrant/plugins/providers/virtualbox/action/import.rb +0 -51
- data/vendor/vagrant/plugins/providers/virtualbox/action/is_paused.rb +0 -20
- data/vendor/vagrant/plugins/providers/virtualbox/action/is_running.rb +0 -20
- data/vendor/vagrant/plugins/providers/virtualbox/action/is_saved.rb +0 -20
- data/vendor/vagrant/plugins/providers/virtualbox/action/match_mac_address.rb +0 -21
- data/vendor/vagrant/plugins/providers/virtualbox/action/message_not_created.rb +0 -16
- data/vendor/vagrant/plugins/providers/virtualbox/action/message_not_running.rb +0 -16
- data/vendor/vagrant/plugins/providers/virtualbox/action/message_will_not_destroy.rb +0 -17
- data/vendor/vagrant/plugins/providers/virtualbox/action/network.rb +0 -366
- data/vendor/vagrant/plugins/providers/virtualbox/action/package.rb +0 -20
- data/vendor/vagrant/plugins/providers/virtualbox/action/package_vagrantfile.rb +0 -33
- data/vendor/vagrant/plugins/providers/virtualbox/action/prepare_forwarded_port_collision_params.rb +0 -35
- data/vendor/vagrant/plugins/providers/virtualbox/action/prepare_nfs_settings.rb +0 -51
- data/vendor/vagrant/plugins/providers/virtualbox/action/prune_nfs_exports.rb +0 -20
- data/vendor/vagrant/plugins/providers/virtualbox/action/resume.rb +0 -25
- data/vendor/vagrant/plugins/providers/virtualbox/action/sane_defaults.rb +0 -87
- data/vendor/vagrant/plugins/providers/virtualbox/action/set_name.rb +0 -40
- data/vendor/vagrant/plugins/providers/virtualbox/action/setup_package_files.rb +0 -51
- data/vendor/vagrant/plugins/providers/virtualbox/action/share_folders.rb +0 -113
- data/vendor/vagrant/plugins/providers/virtualbox/action/suspend.rb +0 -20
- data/vendor/vagrant/plugins/providers/virtualbox/action.rb +0 -308
- data/vendor/vagrant/plugins/providers/virtualbox/config.rb +0 -82
- data/vendor/vagrant/plugins/providers/virtualbox/driver/base.rb +0 -344
- data/vendor/vagrant/plugins/providers/virtualbox/driver/meta.rb +0 -141
- data/vendor/vagrant/plugins/providers/virtualbox/driver/version_4_0.rb +0 -481
- data/vendor/vagrant/plugins/providers/virtualbox/driver/version_4_1.rb +0 -481
- data/vendor/vagrant/plugins/providers/virtualbox/driver/version_4_2.rb +0 -471
- data/vendor/vagrant/plugins/providers/virtualbox/model/forwarded_port.rb +0 -58
- data/vendor/vagrant/plugins/providers/virtualbox/plugin.rb +0 -42
- data/vendor/vagrant/plugins/providers/virtualbox/provider.rb +0 -92
- data/vendor/vagrant/plugins/providers/virtualbox/util/compile_forwarded_ports.rb +0 -31
- data/vendor/vagrant/plugins/provisioners/chef/config/base.rb +0 -65
- data/vendor/vagrant/plugins/provisioners/chef/config/chef_client.rb +0 -39
- data/vendor/vagrant/plugins/provisioners/chef/config/chef_solo.rb +0 -87
- data/vendor/vagrant/plugins/provisioners/chef/plugin.rb +0 -33
- data/vendor/vagrant/plugins/provisioners/chef/provisioner/base.rb +0 -91
- data/vendor/vagrant/plugins/provisioners/chef/provisioner/chef_client.rb +0 -103
- data/vendor/vagrant/plugins/provisioners/chef/provisioner/chef_solo.rb +0 -182
- data/vendor/vagrant/plugins/provisioners/puppet/config/puppet.rb +0 -70
- data/vendor/vagrant/plugins/provisioners/puppet/config/puppet_server.rb +0 -16
- data/vendor/vagrant/plugins/provisioners/puppet/plugin.rb +0 -33
- data/vendor/vagrant/plugins/provisioners/puppet/provisioner/puppet.rb +0 -110
- data/vendor/vagrant/plugins/provisioners/puppet/provisioner/puppet_server.rb +0 -67
- data/vendor/vagrant/plugins/provisioners/shell/config.rb +0 -46
- data/vendor/vagrant/plugins/provisioners/shell/plugin.rb +0 -23
- data/vendor/vagrant/plugins/provisioners/shell/provisioner.rb +0 -66
- data/vendor/vagrant/tasks/acceptance.rake +0 -113
- data/vendor/vagrant/tasks/bundler.rake +0 -3
- data/vendor/vagrant/tasks/test.rake +0 -20
- data/vendor/vagrant/templates/commands/init/Vagrantfile.erb +0 -111
- data/vendor/vagrant/templates/commands/ssh_config/config.erb +0 -16
- data/vendor/vagrant/templates/config/messages.erb +0 -14
- data/vendor/vagrant/templates/config/validation_failed.erb +0 -7
- data/vendor/vagrant/templates/guests/arch/network_dhcp.erb +0 -4
- data/vendor/vagrant/templates/guests/arch/network_static.erb +0 -6
- data/vendor/vagrant/templates/guests/debian/network_dhcp.erb +0 -11
- data/vendor/vagrant/templates/guests/debian/network_static.erb +0 -7
- data/vendor/vagrant/templates/guests/fedora/network_dhcp.erb +0 -6
- data/vendor/vagrant/templates/guests/fedora/network_static.erb +0 -13
- data/vendor/vagrant/templates/guests/freebsd/network_dhcp.erb +0 -3
- data/vendor/vagrant/templates/guests/freebsd/network_static.erb +0 -3
- data/vendor/vagrant/templates/guests/gentoo/network_dhcp.erb +0 -4
- data/vendor/vagrant/templates/guests/gentoo/network_static.erb +0 -4
- data/vendor/vagrant/templates/guests/redhat/network_dhcp.erb +0 -6
- data/vendor/vagrant/templates/guests/redhat/network_static.erb +0 -7
- data/vendor/vagrant/templates/locales/en.yml +0 -993
- data/vendor/vagrant/templates/nfs/exports.erb +0 -5
- data/vendor/vagrant/templates/nfs/exports_freebsd.erb +0 -5
- data/vendor/vagrant/templates/nfs/exports_linux.erb +0 -5
- data/vendor/vagrant/templates/package_Vagrantfile.erb +0 -11
- data/vendor/vagrant/templates/provisioners/chef_client/client.erb +0 -32
- data/vendor/vagrant/templates/provisioners/chef_solo/solo.erb +0 -25
- data/vendor/vagrant/templates/rgloader.rb +0 -9
- data/vendor/vagrant/test/acceptance/base.rb +0 -48
- data/vendor/vagrant/test/acceptance/box_test.rb +0 -99
- data/vendor/vagrant/test/acceptance/destroy_test.rb +0 -37
- data/vendor/vagrant/test/acceptance/halt_test.rb +0 -72
- data/vendor/vagrant/test/acceptance/init_test.rb +0 -33
- data/vendor/vagrant/test/acceptance/networking/host_only_test.rb +0 -37
- data/vendor/vagrant/test/acceptance/networking/port_forward_test.rb +0 -125
- data/vendor/vagrant/test/acceptance/package_test.rb +0 -46
- data/vendor/vagrant/test/acceptance/provisioning/basic_test.rb +0 -61
- data/vendor/vagrant/test/acceptance/provisioning/chef_solo_test.rb +0 -37
- data/vendor/vagrant/test/acceptance/provisioning/shell_test.rb +0 -53
- data/vendor/vagrant/test/acceptance/resume_test.rb +0 -17
- data/vendor/vagrant/test/acceptance/shared_folders_test.rb +0 -84
- data/vendor/vagrant/test/acceptance/skeletons/chef_solo_basic/README.md +0 -3
- data/vendor/vagrant/test/acceptance/skeletons/chef_solo_basic/cookbooks/basic/recipes/default.rb +0 -5
- data/vendor/vagrant/test/acceptance/skeletons/chef_solo_json/README.md +0 -3
- data/vendor/vagrant/test/acceptance/skeletons/chef_solo_json/cookbooks/basic/recipes/default.rb +0 -6
- data/vendor/vagrant/test/acceptance/skeletons/provisioner_multi/README.md +0 -3
- data/vendor/vagrant/test/acceptance/skeletons/provisioner_multi/cookbooks/basic/recipes/default.rb +0 -5
- data/vendor/vagrant/test/acceptance/ssh_test.rb +0 -46
- data/vendor/vagrant/test/acceptance/support/config.rb +0 -42
- data/vendor/vagrant/test/acceptance/support/isolated_environment.rb +0 -118
- data/vendor/vagrant/test/acceptance/support/matchers/have_color.rb +0 -9
- data/vendor/vagrant/test/acceptance/support/matchers/match_output.rb +0 -14
- data/vendor/vagrant/test/acceptance/support/matchers/succeed.rb +0 -14
- data/vendor/vagrant/test/acceptance/support/network_tests.rb +0 -29
- data/vendor/vagrant/test/acceptance/support/output.rb +0 -95
- data/vendor/vagrant/test/acceptance/support/shared/base_context.rb +0 -72
- data/vendor/vagrant/test/acceptance/support/shared/command_examples.rb +0 -33
- data/vendor/vagrant/test/acceptance/support/virtualbox.rb +0 -36
- data/vendor/vagrant/test/acceptance/suspend_test.rb +0 -56
- data/vendor/vagrant/test/acceptance/up_basic_test.rb +0 -33
- data/vendor/vagrant/test/acceptance/up_with_box_url.rb +0 -40
- data/vendor/vagrant/test/acceptance/vagrant_test.rb +0 -47
- data/vendor/vagrant/test/acceptance/version_test.rb +0 -15
- data/vendor/vagrant/test/config/acceptance_boxes.yml +0 -7
- data/vendor/vagrant/test/support/isolated_environment.rb +0 -46
- data/vendor/vagrant/test/support/tempdir.rb +0 -43
- data/vendor/vagrant/test/unit/base.rb +0 -27
- data/vendor/vagrant/test/unit/support/dummy_provider.rb +0 -16
- data/vendor/vagrant/test/unit/support/isolated_environment.rb +0 -177
- data/vendor/vagrant/test/unit/support/shared/base_context.rb +0 -104
- data/vendor/vagrant/test/unit/vagrant/action/builder_test.rb +0 -196
- data/vendor/vagrant/test/unit/vagrant/action/builtin/call_test.rb +0 -145
- data/vendor/vagrant/test/unit/vagrant/action/builtin/confirm_test.rb +0 -36
- data/vendor/vagrant/test/unit/vagrant/action/builtin/env_set_test.rb +0 -20
- data/vendor/vagrant/test/unit/vagrant/action/builtin/graceful_halt_test.rb +0 -61
- data/vendor/vagrant/test/unit/vagrant/action/builtin/lock_test.rb +0 -98
- data/vendor/vagrant/test/unit/vagrant/action/builtin/ssh_exec_test.rb +0 -57
- data/vendor/vagrant/test/unit/vagrant/action/hook_test.rb +0 -101
- data/vendor/vagrant/test/unit/vagrant/action/runner_test.rb +0 -71
- data/vendor/vagrant/test/unit/vagrant/action/warden_test.rb +0 -92
- data/vendor/vagrant/test/unit/vagrant/box_collection_test.rb +0 -224
- data/vendor/vagrant/test/unit/vagrant/box_test.rb +0 -109
- data/vendor/vagrant/test/unit/vagrant/cli_test.rb +0 -27
- data/vendor/vagrant/test/unit/vagrant/config/loader_test.rb +0 -184
- data/vendor/vagrant/test/unit/vagrant/config/v1/dummy_config_test.rb +0 -24
- data/vendor/vagrant/test/unit/vagrant/config/v1/loader_test.rb +0 -145
- data/vendor/vagrant/test/unit/vagrant/config/v1/root_test.rb +0 -40
- data/vendor/vagrant/test/unit/vagrant/config/v2/dummy_config_test.rb +0 -24
- data/vendor/vagrant/test/unit/vagrant/config/v2/loader_test.rb +0 -151
- data/vendor/vagrant/test/unit/vagrant/config/v2/root_test.rb +0 -97
- data/vendor/vagrant/test/unit/vagrant/config/v2/util_test.rb +0 -21
- data/vendor/vagrant/test/unit/vagrant/config_test.rb +0 -66
- data/vendor/vagrant/test/unit/vagrant/downloaders/base_test.rb +0 -14
- data/vendor/vagrant/test/unit/vagrant/downloaders/file_test.rb +0 -87
- data/vendor/vagrant/test/unit/vagrant/downloaders/http_test.rb +0 -23
- data/vendor/vagrant/test/unit/vagrant/environment_test.rb +0 -571
- data/vendor/vagrant/test/unit/vagrant/hosts_test.rb +0 -37
- data/vendor/vagrant/test/unit/vagrant/machine_state_test.rb +0 -26
- data/vendor/vagrant/test/unit/vagrant/machine_test.rb +0 -418
- data/vendor/vagrant/test/unit/vagrant/plugin/v1/command_test.rb +0 -143
- data/vendor/vagrant/test/unit/vagrant/plugin/v1/communicator_test.rb +0 -9
- data/vendor/vagrant/test/unit/vagrant/plugin/v1/config_test.rb +0 -50
- data/vendor/vagrant/test/unit/vagrant/plugin/v1/host_test.rb +0 -5
- data/vendor/vagrant/test/unit/vagrant/plugin/v1/manager_test.rb +0 -114
- data/vendor/vagrant/test/unit/vagrant/plugin/v1/plugin_test.rb +0 -267
- data/vendor/vagrant/test/unit/vagrant/plugin/v1/provider_test.rb +0 -18
- data/vendor/vagrant/test/unit/vagrant/plugin/v2/command_test.rb +0 -238
- data/vendor/vagrant/test/unit/vagrant/plugin/v2/communicator_test.rb +0 -9
- data/vendor/vagrant/test/unit/vagrant/plugin/v2/components_test.rb +0 -17
- data/vendor/vagrant/test/unit/vagrant/plugin/v2/config_test.rb +0 -60
- data/vendor/vagrant/test/unit/vagrant/plugin/v2/host_test.rb +0 -5
- data/vendor/vagrant/test/unit/vagrant/plugin/v2/manager_test.rb +0 -157
- data/vendor/vagrant/test/unit/vagrant/plugin/v2/plugin_test.rb +0 -287
- data/vendor/vagrant/test/unit/vagrant/plugin/v2/provider_test.rb +0 -18
- data/vendor/vagrant/test/unit/vagrant/registry_test.rb +0 -128
- data/vendor/vagrant/test/unit/vagrant/util/ansi_escape_code_remover_test.rb +0 -16
- data/vendor/vagrant/test/unit/vagrant/util/file_checksum_test.rb +0 -23
- data/vendor/vagrant/test/unit/vagrant/util/hash_with_indifferent_access_test.rb +0 -38
- data/vendor/vagrant/test/unit/vagrant/util/is_port_open_test.rb +0 -53
- data/vendor/vagrant/test/unit/vagrant/util/line_endings_helper_test.rb +0 -16
- data/vendor/vagrant/test/unit/vagrant/util/network_ip_test.rb +0 -17
- data/vendor/vagrant/test/unit/vagrant/util/retryable_test.rb +0 -106
- data/vendor/vagrant/test/unit/vagrant/util/scoped_hash_override_test.rb +0 -48
- data/vendor/vagrant/test/unit/vagrant/util/ssh_test.rb +0 -30
- data/vendor/vagrant/test/unit/vagrant/util/string_block_editor_test.rb +0 -98
- data/vendor/vagrant/test/unit/vagrant/util/which_test.rb +0 -43
- data/vendor/vagrant/test/unit/vagrant_test.rb +0 -56
- data/vendor/vagrant/vagrant.gemspec +0 -69
@@ -1,141 +0,0 @@
|
|
1
|
-
require "forwardable"
|
2
|
-
|
3
|
-
require "log4r"
|
4
|
-
|
5
|
-
require File.expand_path("../base", __FILE__)
|
6
|
-
|
7
|
-
module VagrantPlugins
|
8
|
-
module ProviderVirtualBox
|
9
|
-
module Driver
|
10
|
-
class Meta < Base
|
11
|
-
# This is raised if the VM is not found when initializing a driver
|
12
|
-
# with a UUID.
|
13
|
-
class VMNotFound < StandardError; end
|
14
|
-
|
15
|
-
# We use forwardable to do all our driver forwarding
|
16
|
-
extend Forwardable
|
17
|
-
|
18
|
-
# The UUID of the virtual machine we represent
|
19
|
-
attr_reader :uuid
|
20
|
-
|
21
|
-
# The version of virtualbox that is running.
|
22
|
-
attr_reader :version
|
23
|
-
|
24
|
-
def initialize(uuid=nil)
|
25
|
-
# Setup the base
|
26
|
-
super()
|
27
|
-
|
28
|
-
@logger = Log4r::Logger.new("vagrant::provider::virtualbox::meta")
|
29
|
-
@uuid = uuid
|
30
|
-
|
31
|
-
# Read and assign the version of VirtualBox we know which
|
32
|
-
# specific driver to instantiate.
|
33
|
-
begin
|
34
|
-
@version = read_version || ""
|
35
|
-
rescue Vagrant::Util::Subprocess::LaunchError
|
36
|
-
# This means that VirtualBox was not found, so we raise this
|
37
|
-
# error here.
|
38
|
-
raise Vagrant::Errors::VirtualBoxNotDetected
|
39
|
-
end
|
40
|
-
|
41
|
-
# Instantiate the proper version driver for VirtualBox
|
42
|
-
@logger.debug("Finding driver for VirtualBox version: #{@version}")
|
43
|
-
driver_map = {
|
44
|
-
"4.0" => Version_4_0,
|
45
|
-
"4.1" => Version_4_1,
|
46
|
-
"4.2" => Version_4_2
|
47
|
-
}
|
48
|
-
|
49
|
-
driver_klass = nil
|
50
|
-
driver_map.each do |key, klass|
|
51
|
-
if @version.start_with?(key)
|
52
|
-
driver_klass = klass
|
53
|
-
break
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
if !driver_klass
|
58
|
-
supported_versions = driver_map.keys.sort.join(", ")
|
59
|
-
raise Vagrant::Errors::VirtualBoxInvalidVersion, :supported_versions => supported_versions
|
60
|
-
end
|
61
|
-
|
62
|
-
@logger.info("Using VirtualBox driver: #{driver_klass}")
|
63
|
-
@driver = driver_klass.new(@uuid)
|
64
|
-
|
65
|
-
if @uuid
|
66
|
-
# Verify the VM exists, and if it doesn't, then don't worry
|
67
|
-
# about it (mark the UUID as nil)
|
68
|
-
raise VMNotFound if !@driver.vm_exists?(@uuid)
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
def_delegators :@driver, :clear_forwarded_ports,
|
73
|
-
:clear_shared_folders,
|
74
|
-
:create_dhcp_server,
|
75
|
-
:create_host_only_network,
|
76
|
-
:delete,
|
77
|
-
:delete_unused_host_only_networks,
|
78
|
-
:discard_saved_state,
|
79
|
-
:enable_adapters,
|
80
|
-
:execute_command,
|
81
|
-
:export,
|
82
|
-
:forward_ports,
|
83
|
-
:halt,
|
84
|
-
:import,
|
85
|
-
:read_forwarded_ports,
|
86
|
-
:read_bridged_interfaces,
|
87
|
-
:read_guest_additions_version,
|
88
|
-
:read_host_only_interfaces,
|
89
|
-
:read_mac_address,
|
90
|
-
:read_mac_addresses,
|
91
|
-
:read_machine_folder,
|
92
|
-
:read_network_interfaces,
|
93
|
-
:read_state,
|
94
|
-
:read_used_ports,
|
95
|
-
:read_vms,
|
96
|
-
:resume,
|
97
|
-
:set_mac_address,
|
98
|
-
:set_name,
|
99
|
-
:share_folders,
|
100
|
-
:ssh_port,
|
101
|
-
:start,
|
102
|
-
:suspend,
|
103
|
-
:verify!,
|
104
|
-
:verify_image,
|
105
|
-
:vm_exists?
|
106
|
-
|
107
|
-
protected
|
108
|
-
|
109
|
-
# This returns the version of VirtualBox that is running.
|
110
|
-
#
|
111
|
-
# @return [String]
|
112
|
-
def read_version
|
113
|
-
# The version string is usually in one of the following formats:
|
114
|
-
#
|
115
|
-
# * 4.1.8r1234
|
116
|
-
# * 4.1.8r1234_OSE
|
117
|
-
# * 4.1.8_MacPortsr1234
|
118
|
-
#
|
119
|
-
# Below accounts for all of these.
|
120
|
-
|
121
|
-
# Note: We split this into multiple lines because apparently "".split("_")
|
122
|
-
# is [], so we have to check for an empty array in between.
|
123
|
-
output = execute("--version")
|
124
|
-
if output =~ /vboxdrv kernel module is not loaded/
|
125
|
-
raise Vagrant::Errors::VirtualBoxKernelModuleNotLoaded
|
126
|
-
elsif output =~ /Please install/
|
127
|
-
# Check for installation incomplete warnings, for example:
|
128
|
-
# "WARNING: The character device /dev/vboxdrv does not
|
129
|
-
# exist. Please install the virtualbox-ose-dkms package and
|
130
|
-
# the appropriate headers, most likely linux-headers-generic."
|
131
|
-
raise Vagrant::Errors::VirtualBoxInstallIncomplete
|
132
|
-
end
|
133
|
-
|
134
|
-
parts = output.split("_")
|
135
|
-
return nil if parts.empty?
|
136
|
-
parts[0].split("r")[0]
|
137
|
-
end
|
138
|
-
end
|
139
|
-
end
|
140
|
-
end
|
141
|
-
end
|
@@ -1,481 +0,0 @@
|
|
1
|
-
require 'log4r'
|
2
|
-
|
3
|
-
require File.expand_path("../base", __FILE__)
|
4
|
-
|
5
|
-
module VagrantPlugins
|
6
|
-
module ProviderVirtualBox
|
7
|
-
module Driver
|
8
|
-
# Driver for VirtualBox 4.0.x
|
9
|
-
class Version_4_0 < Base
|
10
|
-
def initialize(uuid)
|
11
|
-
super()
|
12
|
-
|
13
|
-
@logger = Log4r::Logger.new("vagrant::provider::virtualbox_4_0")
|
14
|
-
@uuid = uuid
|
15
|
-
end
|
16
|
-
|
17
|
-
def clear_forwarded_ports
|
18
|
-
args = []
|
19
|
-
read_forwarded_ports(@uuid).each do |nic, name, _, _|
|
20
|
-
args.concat(["--natpf#{nic}", "delete", name])
|
21
|
-
end
|
22
|
-
|
23
|
-
execute("modifyvm", @uuid, *args) if !args.empty?
|
24
|
-
end
|
25
|
-
|
26
|
-
def clear_shared_folders
|
27
|
-
info = execute("showvminfo", @uuid, "--machinereadable", :retryable => true)
|
28
|
-
info.split("\n").each do |line|
|
29
|
-
if name = line[/^SharedFolderNameMachineMapping\d+="(.+?)"$/, 1]
|
30
|
-
execute("sharedfolder", "remove", @uuid, "--name", name)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def create_dhcp_server(network, options)
|
36
|
-
execute("dhcpserver", "add", "--ifname", network,
|
37
|
-
"--ip", options[:dhcp_ip],
|
38
|
-
"--netmask", options[:netmask],
|
39
|
-
"--lowerip", options[:dhcp_lower],
|
40
|
-
"--upperip", options[:dhcp_upper],
|
41
|
-
"--enable")
|
42
|
-
end
|
43
|
-
|
44
|
-
def create_host_only_network(options)
|
45
|
-
# Create the interface
|
46
|
-
interface = execute("hostonlyif", "create")
|
47
|
-
name = interface[/^Interface '(.+?)' was successfully created$/, 1]
|
48
|
-
|
49
|
-
# Configure it
|
50
|
-
execute("hostonlyif", "ipconfig", name,
|
51
|
-
"--ip", options[:adapter_ip],
|
52
|
-
"--netmask", options[:netmask])
|
53
|
-
|
54
|
-
# Return the details
|
55
|
-
return {
|
56
|
-
:name => name,
|
57
|
-
:ip => options[:adapter_ip],
|
58
|
-
:netmask => options[:netmask],
|
59
|
-
:dhcp => nil
|
60
|
-
}
|
61
|
-
end
|
62
|
-
|
63
|
-
def delete
|
64
|
-
execute("unregistervm", @uuid, "--delete")
|
65
|
-
end
|
66
|
-
|
67
|
-
def delete_unused_host_only_networks
|
68
|
-
networks = []
|
69
|
-
execute("list", "hostonlyifs").split("\n").each do |line|
|
70
|
-
if network_name = line[/^Name:\s+(.+?)$/, 1]
|
71
|
-
networks << network_name
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
execute("list", "vms").split("\n").each do |line|
|
76
|
-
if vm_name = line[/^".+?"\s+\{(.+?)\}$/, 1]
|
77
|
-
info = execute("showvminfo", vm_name, "--machinereadable", :retryable => true)
|
78
|
-
info.split("\n").each do |line|
|
79
|
-
if network_name = line[/^hostonlyadapter\d+="(.+?)"$/, 1]
|
80
|
-
networks.delete(network_name)
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
networks.each do |name|
|
87
|
-
# First try to remove any DHCP servers attached. We use `raw` because
|
88
|
-
# it is okay if this fails. It usually means that a DHCP server was
|
89
|
-
# never attached.
|
90
|
-
raw("dhcpserver", "remove", "--ifname", name)
|
91
|
-
|
92
|
-
# Delete the actual host only network interface.
|
93
|
-
execute("hostonlyif", "remove", name)
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
def discard_saved_state
|
98
|
-
execute("discardstate", @uuid)
|
99
|
-
end
|
100
|
-
|
101
|
-
def enable_adapters(adapters)
|
102
|
-
args = []
|
103
|
-
adapters.each do |adapter|
|
104
|
-
args.concat(["--nic#{adapter[:adapter]}", adapter[:type].to_s])
|
105
|
-
|
106
|
-
if adapter[:bridge]
|
107
|
-
args.concat(["--bridgeadapter#{adapter[:adapter]}",
|
108
|
-
adapter[:bridge]])
|
109
|
-
end
|
110
|
-
|
111
|
-
if adapter[:hostonly]
|
112
|
-
args.concat(["--hostonlyadapter#{adapter[:adapter]}",
|
113
|
-
adapter[:hostonly]])
|
114
|
-
end
|
115
|
-
|
116
|
-
if adapter[:mac_address]
|
117
|
-
args.concat(["--macaddress#{adapter[:adapter]}",
|
118
|
-
adapter[:mac_address]])
|
119
|
-
end
|
120
|
-
|
121
|
-
if adapter[:nic_type]
|
122
|
-
args.concat(["--nictype#{adapter[:adapter]}", adapter[:nic_type].to_s])
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
execute("modifyvm", @uuid, *args)
|
127
|
-
end
|
128
|
-
|
129
|
-
def execute_command(command)
|
130
|
-
raw(*command)
|
131
|
-
end
|
132
|
-
|
133
|
-
def export(path)
|
134
|
-
# TODO: Progress
|
135
|
-
execute("export", @uuid, "--output", path.to_s)
|
136
|
-
end
|
137
|
-
|
138
|
-
def forward_ports(ports)
|
139
|
-
args = []
|
140
|
-
ports.each do |options|
|
141
|
-
pf_builder = [options[:name],
|
142
|
-
options[:protocol] || "tcp",
|
143
|
-
"",
|
144
|
-
options[:hostport],
|
145
|
-
"",
|
146
|
-
options[:guestport]]
|
147
|
-
|
148
|
-
args.concat(["--natpf#{options[:adapter] || 1}",
|
149
|
-
pf_builder.join(",")])
|
150
|
-
end
|
151
|
-
|
152
|
-
execute("modifyvm", @uuid, *args) if !args.empty?
|
153
|
-
end
|
154
|
-
|
155
|
-
def halt
|
156
|
-
execute("controlvm", @uuid, "poweroff")
|
157
|
-
end
|
158
|
-
|
159
|
-
def import(ovf)
|
160
|
-
output = ""
|
161
|
-
total = ""
|
162
|
-
last = 0
|
163
|
-
execute("import", ovf) do |type, data|
|
164
|
-
if type == :stdout
|
165
|
-
# Keep track of the stdout so that we can get the VM name
|
166
|
-
output << data
|
167
|
-
elsif type == :stderr
|
168
|
-
# Append the data so we can see the full view
|
169
|
-
total << data
|
170
|
-
|
171
|
-
# Break up the lines. We can't get the progress until we see an "OK"
|
172
|
-
lines = total.split("\n")
|
173
|
-
if lines.include?("OK.")
|
174
|
-
# The progress of the import will be in the last line. Do a greedy
|
175
|
-
# regular expression to find what we're looking for.
|
176
|
-
if current = lines.last[/.+(\d{2})%/, 1]
|
177
|
-
current = current.to_i
|
178
|
-
if current > last
|
179
|
-
last = current
|
180
|
-
yield current if block_given?
|
181
|
-
end
|
182
|
-
end
|
183
|
-
end
|
184
|
-
end
|
185
|
-
end
|
186
|
-
|
187
|
-
# Find the name of the VM name
|
188
|
-
name = output[/Suggested VM name "(.+?)"/, 1]
|
189
|
-
if !name
|
190
|
-
@logger.error("Couldn't find VM name in the output.")
|
191
|
-
return nil
|
192
|
-
end
|
193
|
-
|
194
|
-
output = execute("list", "vms")
|
195
|
-
if existing_vm = output[/^"#{Regexp.escape(name)}" \{(.+?)\}$/, 1]
|
196
|
-
return existing_vm
|
197
|
-
end
|
198
|
-
|
199
|
-
nil
|
200
|
-
end
|
201
|
-
|
202
|
-
def read_forwarded_ports(uuid=nil, active_only=false)
|
203
|
-
uuid ||= @uuid
|
204
|
-
|
205
|
-
@logger.debug("read_forward_ports: uuid=#{uuid} active_only=#{active_only}")
|
206
|
-
|
207
|
-
results = []
|
208
|
-
current_nic = nil
|
209
|
-
info = execute("showvminfo", uuid, "--machinereadable", :retryable => true)
|
210
|
-
info.split("\n").each do |line|
|
211
|
-
# This is how we find the nic that a FP is attached to,
|
212
|
-
# since this comes first.
|
213
|
-
if nic = line[/^nic(\d+)=".+?"$/, 1]
|
214
|
-
current_nic = nic.to_i
|
215
|
-
end
|
216
|
-
|
217
|
-
# If we care about active VMs only, then we check the state
|
218
|
-
# to verify the VM is running.
|
219
|
-
if active_only && (state = line[/^VMState="(.+?)"$/, 1] and state != "running")
|
220
|
-
return []
|
221
|
-
end
|
222
|
-
|
223
|
-
# Parse out the forwarded port information
|
224
|
-
if matcher = /^Forwarding.+?="(.+?),.+?,.*?,(.+?),.*?,(.+?)"$/.match(line)
|
225
|
-
result = [current_nic, matcher[1], matcher[2].to_i, matcher[3].to_i]
|
226
|
-
@logger.debug(" - #{result.inspect}")
|
227
|
-
results << result
|
228
|
-
end
|
229
|
-
end
|
230
|
-
|
231
|
-
results
|
232
|
-
end
|
233
|
-
|
234
|
-
def read_bridged_interfaces
|
235
|
-
execute("list", "bridgedifs").split("\n\n").collect do |block|
|
236
|
-
info = {}
|
237
|
-
|
238
|
-
block.split("\n").each do |line|
|
239
|
-
if name = line[/^Name:\s+(.+?)$/, 1]
|
240
|
-
info[:name] = name
|
241
|
-
elsif ip = line[/^IPAddress:\s+(.+?)$/, 1]
|
242
|
-
info[:ip] = ip
|
243
|
-
elsif netmask = line[/^NetworkMask:\s+(.+?)$/, 1]
|
244
|
-
info[:netmask] = netmask
|
245
|
-
elsif status = line[/^Status:\s+(.+?)$/, 1]
|
246
|
-
info[:status] = status
|
247
|
-
end
|
248
|
-
end
|
249
|
-
|
250
|
-
# Return the info to build up the results
|
251
|
-
info
|
252
|
-
end
|
253
|
-
end
|
254
|
-
|
255
|
-
def read_guest_additions_version
|
256
|
-
output = execute("guestproperty", "get", @uuid, "/VirtualBox/GuestAdd/Version",
|
257
|
-
:retryable => true)
|
258
|
-
if value = output[/^Value: (.+?)$/, 1]
|
259
|
-
# Split the version by _ since some distro versions modify it
|
260
|
-
# to look like this: 4.1.2_ubuntu, and the distro part isn't
|
261
|
-
# too important.
|
262
|
-
return value.split("_").first
|
263
|
-
end
|
264
|
-
|
265
|
-
return nil
|
266
|
-
end
|
267
|
-
|
268
|
-
def read_host_only_interfaces
|
269
|
-
dhcp = {}
|
270
|
-
execute("list", "dhcpservers", :retryable => true).split("\n\n").each do |block|
|
271
|
-
info = {}
|
272
|
-
|
273
|
-
block.split("\n").each do |line|
|
274
|
-
if network = line[/^NetworkName:\s+HostInterfaceNetworking-(.+?)$/, 1]
|
275
|
-
info[:network] = network
|
276
|
-
elsif ip = line[/^IP:\s+(.+?)$/, 1]
|
277
|
-
info[:ip] = ip
|
278
|
-
elsif lower = line[/^lowerIPAddress:\s+(.+?)$/, 1]
|
279
|
-
info[:lower] = lower
|
280
|
-
elsif upper = line[/^upperIPAddress:\s+(.+?)$/, 1]
|
281
|
-
info[:upper] = upper
|
282
|
-
end
|
283
|
-
end
|
284
|
-
|
285
|
-
# Set the DHCP info
|
286
|
-
dhcp[info[:network]] = info
|
287
|
-
end
|
288
|
-
|
289
|
-
execute("list", "hostonlyifs", :retryable => true).split("\n\n").collect do |block|
|
290
|
-
info = {}
|
291
|
-
|
292
|
-
block.split("\n").each do |line|
|
293
|
-
if name = line[/^Name:\s+(.+?)$/, 1]
|
294
|
-
info[:name] = name
|
295
|
-
elsif ip = line[/^IPAddress:\s+(.+?)$/, 1]
|
296
|
-
info[:ip] = ip
|
297
|
-
elsif netmask = line[/^NetworkMask:\s+(.+?)$/, 1]
|
298
|
-
info[:netmask] = netmask
|
299
|
-
elsif status = line[/^Status:\s+(.+?)$/, 1]
|
300
|
-
info[:status] = status
|
301
|
-
end
|
302
|
-
end
|
303
|
-
|
304
|
-
# Set the DHCP info if it exists
|
305
|
-
info[:dhcp] = dhcp[info[:name]] if dhcp[info[:name]]
|
306
|
-
|
307
|
-
info
|
308
|
-
end
|
309
|
-
end
|
310
|
-
|
311
|
-
def read_mac_address
|
312
|
-
info = execute("showvminfo", @uuid, "--machinereadable", :retryable => true)
|
313
|
-
info.split("\n").each do |line|
|
314
|
-
if mac = line[/^macaddress1="(.+?)"$/, 1]
|
315
|
-
return mac
|
316
|
-
end
|
317
|
-
end
|
318
|
-
|
319
|
-
nil
|
320
|
-
end
|
321
|
-
|
322
|
-
def read_mac_addresses
|
323
|
-
macs = {}
|
324
|
-
info = execute("showvminfo", @uuid, "--machinereadable", :retryable => true)
|
325
|
-
info.split("\n").each do |line|
|
326
|
-
if matcher = /^macaddress(\d+)="(.+?)"$/.match(line)
|
327
|
-
adapter = matcher[1].to_i
|
328
|
-
mac = matcher[2].to_s
|
329
|
-
macs[adapter] = mac
|
330
|
-
end
|
331
|
-
end
|
332
|
-
macs
|
333
|
-
end
|
334
|
-
|
335
|
-
def read_machine_folder
|
336
|
-
execute("list", "systemproperties", :retryable => true).split("\n").each do |line|
|
337
|
-
if folder = line[/^Default machine folder:\s+(.+?)$/i, 1]
|
338
|
-
return folder
|
339
|
-
end
|
340
|
-
end
|
341
|
-
|
342
|
-
nil
|
343
|
-
end
|
344
|
-
|
345
|
-
def read_network_interfaces
|
346
|
-
nics = {}
|
347
|
-
info = execute("showvminfo", @uuid, "--machinereadable", :retryable => true)
|
348
|
-
info.split("\n").each do |line|
|
349
|
-
if matcher = /^nic(\d+)="(.+?)"$/.match(line)
|
350
|
-
adapter = matcher[1].to_i
|
351
|
-
type = matcher[2].to_sym
|
352
|
-
|
353
|
-
nics[adapter] ||= {}
|
354
|
-
nics[adapter][:type] = type
|
355
|
-
elsif matcher = /^hostonlyadapter(\d+)="(.+?)"$/.match(line)
|
356
|
-
adapter = matcher[1].to_i
|
357
|
-
network = matcher[2].to_s
|
358
|
-
|
359
|
-
nics[adapter] ||= {}
|
360
|
-
nics[adapter][:hostonly] = network
|
361
|
-
elsif matcher = /^bridgeadapter(\d+)="(.+?)"$/.match(line)
|
362
|
-
adapter = matcher[1].to_i
|
363
|
-
network = matcher[2].to_s
|
364
|
-
|
365
|
-
nics[adapter] ||= {}
|
366
|
-
nics[adapter][:bridge] = network
|
367
|
-
end
|
368
|
-
end
|
369
|
-
|
370
|
-
nics
|
371
|
-
end
|
372
|
-
|
373
|
-
def read_state
|
374
|
-
output = execute("showvminfo", @uuid, "--machinereadable", :retryable => true)
|
375
|
-
if output =~ /^name="<inaccessible>"$/
|
376
|
-
return :inaccessible
|
377
|
-
elsif state = output[/^VMState="(.+?)"$/, 1]
|
378
|
-
return state.to_sym
|
379
|
-
end
|
380
|
-
|
381
|
-
nil
|
382
|
-
end
|
383
|
-
|
384
|
-
def read_used_ports
|
385
|
-
ports = []
|
386
|
-
execute("list", "vms", :retryable => true).split("\n").each do |line|
|
387
|
-
if uuid = line[/^".+?" \{(.+?)\}$/, 1]
|
388
|
-
# Ignore our own used ports
|
389
|
-
next if uuid == @uuid
|
390
|
-
|
391
|
-
read_forwarded_ports(uuid, true).each do |_, _, hostport, _|
|
392
|
-
ports << hostport
|
393
|
-
end
|
394
|
-
end
|
395
|
-
end
|
396
|
-
|
397
|
-
ports
|
398
|
-
end
|
399
|
-
|
400
|
-
def read_vms
|
401
|
-
results = {}
|
402
|
-
execute("list", "vms", :retryable => true).split("\n").each do |line|
|
403
|
-
if line =~ /^"(.+?)" \{(.+?)\}$/
|
404
|
-
results[$1.to_s] = $2.to_s
|
405
|
-
end
|
406
|
-
end
|
407
|
-
|
408
|
-
results
|
409
|
-
end
|
410
|
-
|
411
|
-
def set_mac_address(mac)
|
412
|
-
execute("modifyvm", @uuid, "--macaddress1", mac)
|
413
|
-
end
|
414
|
-
|
415
|
-
def set_name(name)
|
416
|
-
execute("modifyvm", @uuid, "--name", name)
|
417
|
-
end
|
418
|
-
|
419
|
-
def share_folders(folders)
|
420
|
-
folders.each do |folder|
|
421
|
-
args = ["--name",
|
422
|
-
folder[:name],
|
423
|
-
"--hostpath",
|
424
|
-
folder[:hostpath]]
|
425
|
-
args << "--transient" if folder.has_key?(:transient) && folder[:transient]
|
426
|
-
execute("sharedfolder", "add", @uuid, *args)
|
427
|
-
end
|
428
|
-
end
|
429
|
-
|
430
|
-
def ssh_port(expected_port)
|
431
|
-
@logger.debug("Searching for SSH port: #{expected_port.inspect}")
|
432
|
-
|
433
|
-
# Look for the forwarded port only by comparing the guest port
|
434
|
-
read_forwarded_ports.each do |_, _, hostport, guestport|
|
435
|
-
return hostport if guestport == expected_port
|
436
|
-
end
|
437
|
-
|
438
|
-
nil
|
439
|
-
end
|
440
|
-
|
441
|
-
def resume
|
442
|
-
@logger.debug("Resuming paused VM...")
|
443
|
-
execute("controlvm", @uuid, "resume")
|
444
|
-
end
|
445
|
-
|
446
|
-
def start(mode)
|
447
|
-
command = ["startvm", @uuid, "--type", mode.to_s]
|
448
|
-
r = raw(*command)
|
449
|
-
|
450
|
-
if r.exit_code == 0 || r.stdout =~ /VM ".+?" has been successfully started/
|
451
|
-
# Some systems return an exit code 1 for some reason. For that
|
452
|
-
# we depend on the output.
|
453
|
-
return true
|
454
|
-
end
|
455
|
-
|
456
|
-
# If we reached this point then it didn't work out.
|
457
|
-
raise Vagrant::Errors::VBoxManageError, :command => command.inspect
|
458
|
-
end
|
459
|
-
|
460
|
-
def suspend
|
461
|
-
execute("controlvm", @uuid, "savestate")
|
462
|
-
end
|
463
|
-
|
464
|
-
def verify!
|
465
|
-
# This command sometimes fails if kernel drivers aren't properly loaded
|
466
|
-
# so we just run the command and verify that it succeeded.
|
467
|
-
execute("list", "hostonlyifs")
|
468
|
-
end
|
469
|
-
|
470
|
-
def verify_image(path)
|
471
|
-
r = raw("import", path.to_s, "--dry-run")
|
472
|
-
return r.exit_code == 0
|
473
|
-
end
|
474
|
-
|
475
|
-
def vm_exists?(uuid)
|
476
|
-
raw("showvminfo", uuid).exit_code == 0
|
477
|
-
end
|
478
|
-
end
|
479
|
-
end
|
480
|
-
end
|
481
|
-
end
|