vagrantup 1.0.7 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +91 -0
- data/LICENSE +2 -2
- data/README.md +11 -13
- data/bin/vagrant +29 -5
- data/config/default.rb +14 -9
- data/contrib/bash/completion.sh +3 -0
- data/keys/README.md +3 -3
- data/lib/vagrant.rb +156 -102
- data/lib/vagrant/action.rb +26 -47
- data/lib/vagrant/action/builder.rb +49 -23
- data/lib/vagrant/action/builtin/box_add.rb +85 -0
- data/lib/vagrant/action/builtin/call.rb +67 -0
- data/lib/vagrant/action/builtin/config_validate.rb +30 -0
- data/lib/vagrant/action/builtin/confirm.rb +38 -0
- data/lib/vagrant/action/builtin/env_set.rb +24 -0
- data/lib/vagrant/action/builtin/graceful_halt.rb +73 -0
- data/lib/vagrant/action/builtin/handle_box_url.rb +43 -0
- data/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb +117 -0
- data/lib/vagrant/action/builtin/lock.rb +57 -0
- data/lib/vagrant/action/builtin/nfs.rb +117 -0
- data/lib/vagrant/action/builtin/provision.rb +70 -0
- data/lib/vagrant/action/builtin/set_hostname.rb +27 -0
- data/lib/vagrant/action/builtin/ssh_exec.rb +42 -0
- data/lib/vagrant/action/builtin/ssh_run.rb +43 -0
- data/lib/vagrant/action/general/package.rb +19 -18
- data/lib/vagrant/action/hook.rb +103 -0
- data/lib/vagrant/action/runner.rb +21 -5
- data/lib/vagrant/action/warden.rb +20 -9
- data/lib/vagrant/box.rb +75 -26
- data/lib/vagrant/box_collection.rb +301 -35
- data/lib/vagrant/cli.rb +20 -14
- data/lib/vagrant/config.rb +23 -9
- data/lib/vagrant/config/loader.rb +131 -36
- data/lib/vagrant/config/v1.rb +9 -0
- data/lib/vagrant/config/v1/dummy_config.rb +13 -0
- data/lib/vagrant/config/v1/loader.rb +105 -0
- data/lib/vagrant/config/v1/root.rb +60 -0
- data/lib/vagrant/config/v2.rb +9 -0
- data/lib/vagrant/config/v2/dummy_config.rb +13 -0
- data/lib/vagrant/config/v2/loader.rb +141 -0
- data/lib/vagrant/config/v2/root.rb +105 -0
- data/lib/vagrant/config/v2/util.rb +21 -0
- data/lib/vagrant/config/version_base.rb +80 -0
- data/lib/vagrant/downloaders/base.rb +0 -3
- data/lib/vagrant/downloaders/file.rb +10 -4
- data/lib/vagrant/downloaders/http.rb +29 -10
- data/lib/vagrant/environment.rb +447 -240
- data/lib/vagrant/errors.rb +138 -97
- data/lib/vagrant/hosts.rb +3 -12
- data/lib/vagrant/machine.rb +325 -0
- data/lib/vagrant/machine_state.rb +45 -0
- data/lib/vagrant/plugin.rb +3 -78
- data/lib/vagrant/plugin/v1.rb +19 -0
- data/lib/vagrant/plugin/v1/command.rb +169 -0
- data/lib/vagrant/plugin/v1/communicator.rb +98 -0
- data/lib/vagrant/plugin/v1/config.rb +112 -0
- data/lib/vagrant/plugin/v1/errors.rb +15 -0
- data/lib/vagrant/plugin/v1/guest.rb +92 -0
- data/lib/vagrant/plugin/v1/host.rb +66 -0
- data/lib/vagrant/plugin/v1/manager.rb +131 -0
- data/lib/vagrant/plugin/v1/plugin.rb +229 -0
- data/lib/vagrant/plugin/v1/provider.rb +68 -0
- data/lib/vagrant/plugin/v1/provisioner.rb +50 -0
- data/lib/vagrant/plugin/v2.rb +22 -0
- data/lib/vagrant/plugin/v2/command.rb +234 -0
- data/lib/vagrant/plugin/v2/communicator.rb +98 -0
- data/lib/vagrant/plugin/v2/components.rb +29 -0
- data/lib/vagrant/plugin/v2/config.rb +101 -0
- data/lib/vagrant/plugin/v2/errors.rb +15 -0
- data/lib/vagrant/plugin/v2/guest.rb +92 -0
- data/lib/vagrant/plugin/v2/host.rb +66 -0
- data/lib/vagrant/plugin/v2/manager.rb +158 -0
- data/lib/vagrant/plugin/v2/plugin.rb +217 -0
- data/lib/vagrant/plugin/v2/provider.rb +69 -0
- data/lib/vagrant/plugin/v2/provisioner.rb +47 -0
- data/lib/vagrant/registry.rb +43 -17
- data/lib/vagrant/ssh.rb +15 -9
- data/lib/vagrant/ui.rb +7 -5
- data/lib/vagrant/util/is_port_open.rb +1 -1
- data/lib/vagrant/util/platform.rb +19 -0
- data/lib/vagrant/util/retryable.rb +8 -2
- data/lib/vagrant/util/safe_exec.rb +2 -2
- data/lib/vagrant/util/scoped_hash_override.rb +45 -0
- data/lib/vagrant/util/ssh.rb +126 -0
- data/lib/vagrant/util/string_block_editor.rb +75 -0
- data/lib/vagrant/util/subprocess.rb +33 -10
- data/lib/vagrant/util/which.rb +43 -0
- data/lib/vagrant/version.rb +1 -1
- data/plugins/README.md +5 -0
- data/plugins/commands/box/command/add.rb +46 -0
- data/plugins/commands/box/command/list.rb +41 -0
- data/plugins/commands/box/command/remove.rb +37 -0
- data/plugins/commands/box/command/repackage.rb +43 -0
- data/plugins/commands/box/command/root.rb +75 -0
- data/plugins/commands/box/plugin.rb +15 -0
- data/plugins/commands/destroy/command.rb +31 -0
- data/plugins/commands/destroy/plugin.rb +18 -0
- data/plugins/commands/halt/command.rb +33 -0
- data/plugins/commands/halt/plugin.rb +18 -0
- data/{lib/vagrant/command/init.rb → plugins/commands/init/command.rb} +4 -4
- data/plugins/commands/init/plugin.rb +18 -0
- data/plugins/commands/package/command.rb +83 -0
- data/plugins/commands/package/plugin.rb +18 -0
- data/plugins/commands/plugin/action.rb +52 -0
- data/plugins/commands/plugin/action/bundler_check.rb +25 -0
- data/plugins/commands/plugin/action/install_gem.rb +70 -0
- data/plugins/commands/plugin/action/license_plugin.rb +54 -0
- data/plugins/commands/plugin/action/list_plugins.rb +54 -0
- data/plugins/commands/plugin/action/prune_gems.rb +149 -0
- data/plugins/commands/plugin/action/uninstall_plugin.rb +23 -0
- data/plugins/commands/plugin/command/base.rb +22 -0
- data/plugins/commands/plugin/command/install.rb +39 -0
- data/plugins/commands/plugin/command/license.rb +31 -0
- data/plugins/commands/plugin/command/list.rb +28 -0
- data/plugins/commands/plugin/command/root.rb +75 -0
- data/plugins/commands/plugin/command/uninstall.rb +28 -0
- data/plugins/commands/plugin/gem_helper.rb +74 -0
- data/plugins/commands/plugin/plugin.rb +22 -0
- data/plugins/commands/plugin/state_file.rb +57 -0
- data/plugins/commands/provision/command.rb +34 -0
- data/plugins/commands/provision/plugin.rb +18 -0
- data/plugins/commands/reload/command.rb +37 -0
- data/plugins/commands/reload/plugin.rb +18 -0
- data/plugins/commands/resume/command.rb +25 -0
- data/plugins/commands/resume/plugin.rb +17 -0
- data/{lib/vagrant/command/ssh.rb → plugins/commands/ssh/command.rb} +17 -41
- data/plugins/commands/ssh/plugin.rb +17 -0
- data/{lib/vagrant/command/ssh_config.rb → plugins/commands/ssh_config/command.rb} +14 -16
- data/plugins/commands/ssh_config/plugin.rb +18 -0
- data/plugins/commands/status/command.rb +39 -0
- data/plugins/commands/status/plugin.rb +18 -0
- data/plugins/commands/suspend/command.rb +25 -0
- data/plugins/commands/suspend/plugin.rb +18 -0
- data/plugins/commands/up/command.rb +45 -0
- data/plugins/commands/up/plugin.rb +17 -0
- data/{lib/vagrant/command → plugins/commands/up}/start_mixins.rb +6 -6
- data/{lib/vagrant/communication/ssh.rb → plugins/communicators/ssh/communicator.rb} +139 -52
- data/plugins/communicators/ssh/plugin.rb +19 -0
- data/plugins/guests/arch/guest.rb +41 -0
- data/plugins/guests/arch/plugin.rb +15 -0
- data/{lib/vagrant/guest/debian.rb → plugins/guests/debian/guest.rb} +21 -13
- data/plugins/guests/debian/plugin.rb +15 -0
- data/{lib/vagrant/guest/fedora.rb → plugins/guests/fedora/guest.rb} +19 -14
- data/plugins/guests/fedora/plugin.rb +15 -0
- data/plugins/guests/freebsd/config.rb +13 -0
- data/plugins/guests/freebsd/guest.rb +70 -0
- data/plugins/guests/freebsd/plugin.rb +20 -0
- data/plugins/guests/gentoo/guest.rb +51 -0
- data/plugins/guests/gentoo/plugin.rb +15 -0
- data/plugins/guests/linux/config.rb +13 -0
- data/{lib/vagrant/guest/linux.rb → plugins/guests/linux/guest.rb} +35 -34
- data/plugins/guests/linux/plugin.rb +20 -0
- data/plugins/guests/openbsd/guest.rb +13 -0
- data/plugins/guests/openbsd/plugin.rb +15 -0
- data/{lib/vagrant/guest/redhat.rb → plugins/guests/redhat/guest.rb} +22 -15
- data/plugins/guests/redhat/plugin.rb +15 -0
- data/plugins/guests/solaris/config.rb +18 -0
- data/plugins/guests/solaris/guest.rb +73 -0
- data/plugins/guests/solaris/plugin.rb +20 -0
- data/plugins/guests/suse/guest.rb +24 -0
- data/plugins/guests/suse/plugin.rb +15 -0
- data/plugins/guests/ubuntu/guest.rb +44 -0
- data/plugins/guests/ubuntu/plugin.rb +15 -0
- data/{lib/vagrant/hosts/arch.rb → plugins/hosts/arch/host.rb} +18 -5
- data/plugins/hosts/arch/plugin.rb +15 -0
- data/{lib/vagrant/hosts/bsd.rb → plugins/hosts/bsd/host.rb} +16 -11
- data/plugins/hosts/bsd/plugin.rb +15 -0
- data/{lib/vagrant/hosts/fedora.rb → plugins/hosts/fedora/host.rb} +8 -4
- data/plugins/hosts/fedora/plugin.rb +15 -0
- data/{lib/vagrant/hosts/freebsd.rb → plugins/hosts/freebsd/host.rb} +10 -8
- data/plugins/hosts/freebsd/plugin.rb +15 -0
- data/{lib/vagrant/hosts/gentoo.rb → plugins/hosts/gentoo/host.rb} +7 -3
- data/plugins/hosts/gentoo/plugin.rb +15 -0
- data/{lib/vagrant/hosts/linux.rb → plugins/hosts/linux/host.rb} +12 -11
- data/plugins/hosts/linux/plugin.rb +15 -0
- data/{lib/vagrant/hosts/opensuse.rb → plugins/hosts/opensuse/host.rb} +8 -4
- data/plugins/hosts/opensuse/plugin.rb +15 -0
- data/{lib/vagrant/hosts/windows.rb → plugins/hosts/windows/host.rb} +5 -4
- data/plugins/hosts/windows/plugin.rb +15 -0
- data/plugins/kernel_v1/config/nfs.rb +20 -0
- data/plugins/kernel_v1/config/package.rb +17 -0
- data/plugins/kernel_v1/config/ssh.rb +46 -0
- data/plugins/kernel_v1/config/vagrant.rb +31 -0
- data/plugins/kernel_v1/config/vm.rb +184 -0
- data/plugins/kernel_v1/plugin.rb +44 -0
- data/plugins/kernel_v2/config/nfs.rb +10 -0
- data/plugins/kernel_v2/config/package.rb +9 -0
- data/plugins/kernel_v2/config/ssh.rb +35 -0
- data/plugins/kernel_v2/config/vagrant.rb +9 -0
- data/plugins/kernel_v2/config/vm.rb +314 -0
- data/plugins/kernel_v2/config/vm_provisioner.rb +40 -0
- data/plugins/kernel_v2/config/vm_subvm.rb +30 -0
- data/plugins/kernel_v2/plugin.rb +44 -0
- data/plugins/providers/virtualbox/action.rb +308 -0
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/boot.rb +12 -16
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/check_accessible.rb +5 -5
- data/plugins/providers/virtualbox/action/check_created.rb +21 -0
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/check_guest_additions.rb +18 -11
- data/plugins/providers/virtualbox/action/check_running.rb +21 -0
- data/plugins/providers/virtualbox/action/check_virtualbox.rb +22 -0
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/clean_machine_folder.rb +5 -5
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/clear_forwarded_ports.rb +4 -4
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/clear_network_interfaces.rb +4 -4
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/clear_shared_folders.rb +4 -5
- data/plugins/providers/virtualbox/action/created.rb +20 -0
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/customize.rb +7 -7
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/destroy.rb +5 -5
- data/plugins/providers/virtualbox/action/destroy_confirm.rb +17 -0
- data/plugins/providers/virtualbox/action/destroy_unused_network_interfaces.rb +16 -0
- data/plugins/providers/virtualbox/action/discard_state.rb +20 -0
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/export.rb +7 -7
- data/plugins/providers/virtualbox/action/forced_halt.rb +25 -0
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/forward_ports.rb +29 -42
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/import.rb +15 -12
- data/plugins/providers/virtualbox/action/is_paused.rb +20 -0
- data/plugins/providers/virtualbox/action/is_running.rb +20 -0
- data/plugins/providers/virtualbox/action/is_saved.rb +20 -0
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/match_mac_address.rb +5 -5
- data/plugins/providers/virtualbox/action/message_not_created.rb +16 -0
- data/plugins/providers/virtualbox/action/message_not_running.rb +16 -0
- data/plugins/providers/virtualbox/action/message_will_not_destroy.rb +17 -0
- data/plugins/providers/virtualbox/action/network.rb +366 -0
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/package.rb +4 -7
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/package_vagrantfile.rb +5 -8
- data/plugins/providers/virtualbox/action/prepare_forwarded_port_collision_params.rb +35 -0
- data/plugins/providers/virtualbox/action/prepare_nfs_settings.rb +51 -0
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/prune_nfs_exports.rb +5 -5
- data/plugins/providers/virtualbox/action/resume.rb +25 -0
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/sane_defaults.rb +41 -32
- data/plugins/providers/virtualbox/action/set_name.rb +40 -0
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/setup_package_files.rb +5 -8
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/share_folders.rb +24 -25
- data/{lib/vagrant/action/vm → plugins/providers/virtualbox/action}/suspend.rb +5 -5
- data/plugins/providers/virtualbox/config.rb +82 -0
- data/plugins/providers/virtualbox/driver/base.rb +344 -0
- data/plugins/providers/virtualbox/driver/meta.rb +142 -0
- data/plugins/providers/virtualbox/driver/version_4_0.rb +485 -0
- data/plugins/providers/virtualbox/driver/version_4_1.rb +485 -0
- data/plugins/providers/virtualbox/driver/version_4_2.rb +475 -0
- data/plugins/providers/virtualbox/model/forwarded_port.rb +58 -0
- data/plugins/providers/virtualbox/plugin.rb +42 -0
- data/plugins/providers/virtualbox/provider.rb +92 -0
- data/plugins/providers/virtualbox/util/compile_forwarded_ports.rb +31 -0
- data/plugins/provisioners/chef/config/base.rb +65 -0
- data/plugins/provisioners/chef/config/chef_client.rb +39 -0
- data/plugins/provisioners/chef/config/chef_solo.rb +87 -0
- data/plugins/provisioners/chef/plugin.rb +33 -0
- data/plugins/provisioners/chef/provisioner/base.rb +91 -0
- data/plugins/provisioners/chef/provisioner/chef_client.rb +103 -0
- data/plugins/provisioners/chef/provisioner/chef_solo.rb +182 -0
- data/plugins/provisioners/puppet/config/puppet.rb +70 -0
- data/plugins/provisioners/puppet/config/puppet_server.rb +16 -0
- data/plugins/provisioners/puppet/plugin.rb +33 -0
- data/plugins/provisioners/puppet/provisioner/puppet.rb +110 -0
- data/plugins/provisioners/puppet/provisioner/puppet_server.rb +67 -0
- data/plugins/provisioners/shell/config.rb +46 -0
- data/plugins/provisioners/shell/plugin.rb +23 -0
- data/plugins/provisioners/shell/provisioner.rb +66 -0
- data/templates/commands/init/Vagrantfile.erb +33 -21
- data/templates/commands/ssh_config/config.erb +1 -0
- data/templates/config/messages.erb +14 -0
- data/templates/config/validation_failed.erb +3 -3
- data/templates/guests/arch/network_dhcp.erb +4 -7
- data/templates/guests/arch/network_static.erb +6 -7
- data/templates/guests/debian/network_dhcp.erb +5 -0
- data/templates/locales/en.yml +336 -100
- data/templates/rgloader.rb +9 -0
- data/test/acceptance/support/isolated_environment.rb +3 -2
- data/test/support/tempdir.rb +13 -4
- data/test/unit/base.rb +6 -0
- data/test/unit/support/dummy_provider.rb +16 -0
- data/test/unit/support/isolated_environment.rb +132 -0
- data/test/unit/support/shared/base_context.rb +74 -0
- data/test/unit/vagrant/action/builder_test.rb +88 -48
- data/test/unit/vagrant/action/builtin/call_test.rb +145 -0
- data/test/unit/vagrant/action/builtin/confirm_test.rb +36 -0
- data/test/unit/vagrant/action/builtin/env_set_test.rb +20 -0
- data/test/unit/vagrant/action/builtin/graceful_halt_test.rb +61 -0
- data/test/unit/vagrant/action/builtin/lock_test.rb +98 -0
- data/test/unit/vagrant/action/builtin/ssh_exec_test.rb +57 -0
- data/test/unit/vagrant/action/hook_test.rb +101 -0
- data/test/unit/vagrant/action/runner_test.rb +15 -9
- data/test/unit/vagrant/box_collection_test.rb +219 -38
- data/test/unit/vagrant/box_test.rb +94 -19
- data/test/unit/vagrant/cli_test.rb +27 -0
- data/test/unit/vagrant/config/loader_test.rb +154 -49
- data/test/unit/vagrant/config/v1/dummy_config_test.rb +24 -0
- data/test/unit/vagrant/config/v1/loader_test.rb +145 -0
- data/test/unit/vagrant/config/v1/root_test.rb +40 -0
- data/test/unit/vagrant/config/v2/dummy_config_test.rb +24 -0
- data/test/unit/vagrant/config/v2/loader_test.rb +151 -0
- data/test/unit/vagrant/config/v2/root_test.rb +97 -0
- data/test/unit/vagrant/config/v2/util_test.rb +21 -0
- data/test/unit/vagrant/config_test.rb +40 -1
- data/test/unit/vagrant/downloaders/base_test.rb +0 -4
- data/test/unit/vagrant/downloaders/file_test.rb +21 -9
- data/test/unit/vagrant/downloaders/http_test.rb +4 -0
- data/test/unit/vagrant/environment_test.rb +414 -63
- data/test/unit/vagrant/hosts_test.rb +10 -9
- data/test/unit/vagrant/machine_state_test.rb +26 -0
- data/test/unit/vagrant/machine_test.rb +418 -0
- data/test/unit/vagrant/{command/base_test.rb → plugin/v1/command_test.rb} +2 -9
- data/test/unit/vagrant/plugin/v1/communicator_test.rb +9 -0
- data/test/unit/vagrant/plugin/v1/config_test.rb +50 -0
- data/test/unit/vagrant/plugin/v1/host_test.rb +5 -0
- data/test/unit/vagrant/plugin/v1/manager_test.rb +114 -0
- data/test/unit/vagrant/plugin/v1/plugin_test.rb +267 -0
- data/test/unit/vagrant/plugin/v1/provider_test.rb +18 -0
- data/test/unit/vagrant/plugin/v2/command_test.rb +238 -0
- data/test/unit/vagrant/plugin/v2/communicator_test.rb +9 -0
- data/test/unit/vagrant/plugin/v2/components_test.rb +17 -0
- data/test/unit/vagrant/plugin/v2/config_test.rb +60 -0
- data/test/unit/vagrant/plugin/v2/host_test.rb +5 -0
- data/test/unit/vagrant/plugin/v2/manager_test.rb +157 -0
- data/test/unit/vagrant/plugin/v2/plugin_test.rb +287 -0
- data/test/unit/vagrant/plugin/v2/provider_test.rb +18 -0
- data/test/unit/vagrant/registry_test.rb +59 -5
- data/test/unit/vagrant/util/scoped_hash_override_test.rb +48 -0
- data/test/unit/vagrant/util/ssh_test.rb +30 -0
- data/test/unit/vagrant/util/string_block_editor_test.rb +98 -0
- data/test/unit/vagrant/util/which_test.rb +43 -0
- data/test/unit/vagrant_test.rb +42 -13
- data/vagrant.gemspec +6 -7
- data/vagrant.gemspecbak +6 -7
- metadata +273 -358
- data/lib/vagrant/action/box/destroy.rb +0 -25
- data/lib/vagrant/action/box/download.rb +0 -84
- data/lib/vagrant/action/box/package.rb +0 -19
- data/lib/vagrant/action/box/unpackage.rb +0 -61
- data/lib/vagrant/action/box/verify.rb +0 -23
- data/lib/vagrant/action/builtin.rb +0 -171
- data/lib/vagrant/action/env/set.rb +0 -21
- data/lib/vagrant/action/environment.rb +0 -12
- data/lib/vagrant/action/general/check_virtualbox.rb +0 -28
- data/lib/vagrant/action/general/validate.rb +0 -18
- data/lib/vagrant/action/vm/check_box.rb +0 -33
- data/lib/vagrant/action/vm/check_port_collisions.rb +0 -89
- data/lib/vagrant/action/vm/default_name.rb +0 -22
- data/lib/vagrant/action/vm/destroy_unused_network_interfaces.rb +0 -20
- data/lib/vagrant/action/vm/discard_state.rb +0 -22
- data/lib/vagrant/action/vm/halt.rb +0 -32
- data/lib/vagrant/action/vm/host_name.rb +0 -21
- data/lib/vagrant/action/vm/network.rb +0 -403
- data/lib/vagrant/action/vm/nfs.rb +0 -196
- data/lib/vagrant/action/vm/provision.rb +0 -61
- data/lib/vagrant/action/vm/provisioner_cleanup.rb +0 -26
- data/lib/vagrant/action/vm/resume.rb +0 -20
- data/lib/vagrant/command.rb +0 -24
- data/lib/vagrant/command/base.rb +0 -167
- data/lib/vagrant/command/box.rb +0 -58
- data/lib/vagrant/command/box_add.rb +0 -37
- data/lib/vagrant/command/box_list.rb +0 -28
- data/lib/vagrant/command/box_remove.rb +0 -27
- data/lib/vagrant/command/box_repackage.rb +0 -27
- data/lib/vagrant/command/destroy.rb +0 -64
- data/lib/vagrant/command/gem.rb +0 -39
- data/lib/vagrant/command/halt.rb +0 -39
- data/lib/vagrant/command/package.rb +0 -75
- data/lib/vagrant/command/provision.rb +0 -40
- data/lib/vagrant/command/reload.rb +0 -39
- data/lib/vagrant/command/resume.rb +0 -33
- data/lib/vagrant/command/status.rb +0 -36
- data/lib/vagrant/command/suspend.rb +0 -33
- data/lib/vagrant/command/up.rb +0 -40
- data/lib/vagrant/communication.rb +0 -7
- data/lib/vagrant/communication/base.rb +0 -56
- data/lib/vagrant/config/base.rb +0 -82
- data/lib/vagrant/config/error_recorder.rb +0 -19
- data/lib/vagrant/config/nfs.rb +0 -8
- data/lib/vagrant/config/package.rb +0 -7
- data/lib/vagrant/config/ssh.rb +0 -27
- data/lib/vagrant/config/top.rb +0 -72
- data/lib/vagrant/config/vagrant.rb +0 -14
- data/lib/vagrant/config/vm.rb +0 -168
- data/lib/vagrant/config/vm/provisioner.rb +0 -52
- data/lib/vagrant/config/vm/sub_vm.rb +0 -17
- data/lib/vagrant/data_store.rb +0 -92
- data/lib/vagrant/driver.rb +0 -8
- data/lib/vagrant/driver/virtualbox.rb +0 -134
- data/lib/vagrant/driver/virtualbox_4_0.rb +0 -459
- data/lib/vagrant/driver/virtualbox_4_1.rb +0 -459
- data/lib/vagrant/driver/virtualbox_4_2.rb +0 -606
- data/lib/vagrant/driver/virtualbox_base.rb +0 -326
- data/lib/vagrant/guest.rb +0 -18
- data/lib/vagrant/guest/arch.rb +0 -56
- data/lib/vagrant/guest/base.rb +0 -99
- data/lib/vagrant/guest/freebsd.rb +0 -86
- data/lib/vagrant/guest/gentoo.rb +0 -46
- data/lib/vagrant/guest/linux/config.rb +0 -19
- data/lib/vagrant/guest/linux/error.rb +0 -9
- data/lib/vagrant/guest/openbsd.rb +0 -20
- data/lib/vagrant/guest/solaris.rb +0 -118
- data/lib/vagrant/guest/suse.rb +0 -17
- data/lib/vagrant/guest/ubuntu.rb +0 -23
- data/lib/vagrant/hosts/base.rb +0 -66
- data/lib/vagrant/provisioners.rb +0 -12
- data/lib/vagrant/provisioners/base.rb +0 -44
- data/lib/vagrant/provisioners/chef.rb +0 -168
- data/lib/vagrant/provisioners/chef_client.rb +0 -132
- data/lib/vagrant/provisioners/chef_solo.rb +0 -234
- data/lib/vagrant/provisioners/puppet.rb +0 -176
- data/lib/vagrant/provisioners/puppet_server.rb +0 -78
- data/lib/vagrant/provisioners/shell.rb +0 -103
- data/lib/vagrant/vm.rb +0 -195
- data/test/buildbot/README.md +0 -72
- data/test/buildbot/buildbot_config/__init__.py +0 -0
- data/test/buildbot/buildbot_config/config/__init__.py +0 -0
- data/test/buildbot/buildbot_config/config/loader.py +0 -24
- data/test/buildbot/buildbot_config/config/master.py +0 -24
- data/test/buildbot/buildbot_config/config/slave.py +0 -22
- data/test/buildbot/buildbot_config/master/__init__.py +0 -6
- data/test/buildbot/buildbot_config/master/builders.py +0 -78
- data/test/buildbot/buildbot_config/master/buildsteps.py +0 -100
- data/test/buildbot/buildbot_config/master/change_sources.py +0 -8
- data/test/buildbot/buildbot_config/master/schedulers.py +0 -32
- data/test/buildbot/buildbot_config/master/slaves.py +0 -60
- data/test/buildbot/buildbot_config/master/status.py +0 -52
- data/test/buildbot/master/Makefile.sample +0 -28
- data/test/buildbot/master/buildbot.tac +0 -36
- data/test/buildbot/master/master.cfg +0 -67
- data/test/buildbot/master/public_html/bg_gradient.jpg +0 -0
- data/test/buildbot/master/public_html/default.css +0 -545
- data/test/buildbot/master/public_html/favicon.ico +0 -0
- data/test/buildbot/master/public_html/robots.txt +0 -10
- data/test/buildbot/master/public_html/static/css/bootstrap-1.4.0.min.css +0 -356
- data/test/buildbot/master/public_html/static/css/prettify.css +0 -97
- data/test/buildbot/master/public_html/static/css/syntax.css +0 -60
- data/test/buildbot/master/public_html/static/css/vagrant.base.css +0 -205
- data/test/buildbot/master/public_html/static/images/base_box_mac.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/getting-started/success.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/icons/error.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_chilling.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_holding.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_looking.png +0 -0
- data/test/buildbot/master/public_html/static/images/windows/alter_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/edit_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/environment_variables_button.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/port_and_ppk_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/ppk_selection.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/putty_first_screen.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/save_result.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/vbox_manage_default_location.jpg +0 -0
- data/test/buildbot/master/public_html/static/js/bootstrap-tabs.js +0 -80
- data/test/buildbot/master/public_html/static/js/jquery-1.7.min.js +0 -4
- data/test/buildbot/master/templates/authfail.html +0 -9
- data/test/buildbot/master/templates/build.html +0 -205
- data/test/buildbot/master/templates/builder.html +0 -118
- data/test/buildbot/master/templates/builders.html +0 -33
- data/test/buildbot/master/templates/buildslave.html +0 -72
- data/test/buildbot/master/templates/buildslaves.html +0 -70
- data/test/buildbot/master/templates/change.html +0 -15
- data/test/buildbot/master/templates/layouts/base.html +0 -58
- data/test/buildbot/master/templates/macros/box.html +0 -37
- data/test/buildbot/master/templates/macros/build_line.html +0 -50
- data/test/buildbot/master/templates/macros/change.html +0 -81
- data/test/buildbot/master/templates/macros/forms.html +0 -300
- data/test/buildbot/master/templates/root.html +0 -42
- data/test/buildbot/master/templates/waterfall.html +0 -53
- data/test/buildbot/requirements.txt +0 -4
- data/test/buildbot/scripts/deploy.sh +0 -38
- data/test/buildbot/scripts/setup.sh +0 -107
- data/test/buildbot/slave/buildbot.tac +0 -43
- data/test/buildbot/slave/info/admin +0 -1
- data/test/buildbot/slave/info/host +0 -1
- data/test/buildbot/tests/__init__.py +0 -0
- data/test/buildbot/tests/master/__init__.py +0 -0
- data/test/buildbot/tests/master/test_slaves.py +0 -41
- data/test/buildbot/vendor/choices-0.4.0.tar.gz +0 -0
- data/test/unit/vagrant/action/environment_test.rb +0 -16
- data/test/unit/vagrant/config/base_test.rb +0 -48
- data/test/unit/vagrant/config/ssh_test.rb +0 -17
- data/test/unit/vagrant/config/top_test.rb +0 -69
- data/test/unit/vagrant/config/vm_test.rb +0 -71
- data/test/unit/vagrant/data_store_test.rb +0 -79
- data/test/unit_legacy/locales/en.yml +0 -8
- data/test/unit_legacy/test_helper.rb +0 -32
- data/test/unit_legacy/vagrant/action/box/destroy_test.rb +0 -18
- data/test/unit_legacy/vagrant/action/box/download_test.rb +0 -125
- data/test/unit_legacy/vagrant/action/box/package_test.rb +0 -25
- data/test/unit_legacy/vagrant/action/box/unpackage_test.rb +0 -84
- data/test/unit_legacy/vagrant/action/box/verify_test.rb +0 -30
- data/test/unit_legacy/vagrant/action/env/set_test.rb +0 -24
- data/test/unit_legacy/vagrant/action/general/package_test.rb +0 -268
- data/test/unit_legacy/vagrant/action/general/validate_test.rb +0 -31
- data/test/unit_legacy/vagrant/action/vm/boot_test.rb +0 -66
- data/test/unit_legacy/vagrant/action/vm/check_accessible_test.rb +0 -61
- data/test/unit_legacy/vagrant/action/vm/check_box_test.rb +0 -61
- data/test/unit_legacy/vagrant/action/vm/check_guest_additions_test.rb +0 -9
- data/test/unit_legacy/vagrant/action/vm/clean_machine_folder_test.rb +0 -84
- data/test/unit_legacy/vagrant/action/vm/clear_forwarded_ports_test.rb +0 -52
- data/test/unit_legacy/vagrant/action/vm/clear_nfs_exports_test.rb +0 -22
- data/test/unit_legacy/vagrant/action/vm/clear_shared_folders_test.rb +0 -40
- data/test/unit_legacy/vagrant/action/vm/customize_test.rb +0 -37
- data/test/unit_legacy/vagrant/action/vm/destroy_test.rb +0 -25
- data/test/unit_legacy/vagrant/action/vm/destroy_unused_network_interfaces_test.rb +0 -49
- data/test/unit_legacy/vagrant/action/vm/discard_state_test.rb +0 -45
- data/test/unit_legacy/vagrant/action/vm/export_test.rb +0 -107
- data/test/unit_legacy/vagrant/action/vm/forward_ports_helpers_test.rb +0 -77
- data/test/unit_legacy/vagrant/action/vm/forward_ports_test.rb +0 -197
- data/test/unit_legacy/vagrant/action/vm/halt_test.rb +0 -79
- data/test/unit_legacy/vagrant/action/vm/host_name_test.rb +0 -36
- data/test/unit_legacy/vagrant/action/vm/import_test.rb +0 -66
- data/test/unit_legacy/vagrant/action/vm/match_mac_address_test.rb +0 -40
- data/test/unit_legacy/vagrant/action/vm/modify_test.rb +0 -38
- data/test/unit_legacy/vagrant/action/vm/network_test.rb +0 -286
- data/test/unit_legacy/vagrant/action/vm/nfs_helpers_test.rb +0 -26
- data/test/unit_legacy/vagrant/action/vm/nfs_test.rb +0 -260
- data/test/unit_legacy/vagrant/action/vm/package_test.rb +0 -25
- data/test/unit_legacy/vagrant/action/vm/package_vagrantfile_test.rb +0 -46
- data/test/unit_legacy/vagrant/action/vm/provision_test.rb +0 -65
- data/test/unit_legacy/vagrant/action/vm/provisioner_cleanup_test.rb +0 -56
- data/test/unit_legacy/vagrant/action/vm/resume_test.rb +0 -35
- data/test/unit_legacy/vagrant/action/vm/share_folders_test.rb +0 -144
- data/test/unit_legacy/vagrant/action/vm/suspend_test.rb +0 -35
- data/test/unit_legacy/vagrant/action_test.rb +0 -89
- data/test/unit_legacy/vagrant/box_collection_test.rb +0 -45
- data/test/unit_legacy/vagrant/box_test.rb +0 -74
- data/test/unit_legacy/vagrant/cli_test.rb +0 -35
- data/test/unit_legacy/vagrant/command/base_test.rb +0 -23
- data/test/unit_legacy/vagrant/command/group_base_test.rb +0 -15
- data/test/unit_legacy/vagrant/command/helpers_test.rb +0 -88
- data/test/unit_legacy/vagrant/command/init_test.rb +0 -10
- data/test/unit_legacy/vagrant/command/package_test.rb +0 -27
- data/test/unit_legacy/vagrant/config/base_test.rb +0 -52
- data/test/unit_legacy/vagrant/config/error_recorder_test.rb +0 -18
- data/test/unit_legacy/vagrant/config/ssh_test.rb +0 -12
- data/test/unit_legacy/vagrant/config/vagrant_test.rb +0 -35
- data/test/unit_legacy/vagrant/config/vm/provisioner_test.rb +0 -92
- data/test/unit_legacy/vagrant/config/vm_test.rb +0 -47
- data/test/unit_legacy/vagrant/config_test.rb +0 -148
- data/test/unit_legacy/vagrant/downloaders/http_test.rb +0 -93
- data/test/unit_legacy/vagrant/environment_test.rb +0 -539
- data/test/unit_legacy/vagrant/errors_test.rb +0 -42
- data/test/unit_legacy/vagrant/hosts/base_test.rb +0 -46
- data/test/unit_legacy/vagrant/hosts/bsd_test.rb +0 -53
- data/test/unit_legacy/vagrant/hosts/linux_test.rb +0 -54
- data/test/unit_legacy/vagrant/plugin_test.rb +0 -9
- data/test/unit_legacy/vagrant/provisioners/base_test.rb +0 -63
- data/test/unit_legacy/vagrant/provisioners/chef_client_test.rb +0 -190
- data/test/unit_legacy/vagrant/provisioners/chef_solo_test.rb +0 -115
- data/test/unit_legacy/vagrant/provisioners/chef_test.rb +0 -209
- data/test/unit_legacy/vagrant/provisioners/puppet_server_test.rb +0 -68
- data/test/unit_legacy/vagrant/provisioners/puppet_test.rb +0 -182
- data/test/unit_legacy/vagrant/provisioners/shell_test.rb +0 -79
- data/test/unit_legacy/vagrant/ssh/session_test.rb +0 -40
- data/test/unit_legacy/vagrant/ssh_test.rb +0 -304
- data/test/unit_legacy/vagrant/systems/base_test.rb +0 -18
- data/test/unit_legacy/vagrant/systems/linux_test.rb +0 -104
- data/test/unit_legacy/vagrant/util/busy_test.rb +0 -106
- data/test/unit_legacy/vagrant/util/counter_test.rb +0 -29
- data/test/unit_legacy/vagrant/util/platform_test.rb +0 -18
- data/test/unit_legacy/vagrant/util/stacked_proc_runner_test.rb +0 -43
- data/test/unit_legacy/vagrant/util/template_renderer_test.rb +0 -145
- data/test/unit_legacy/vagrant/vm_test.rb +0 -300
- data/vagrant-1.1.4.gem +0 -0
- data/vagrantup-0.1.0.gem +0 -0
- data/vagrantup-0.1.1.gem +0 -0
- data/vagrantup-0.1.2.gem +0 -0
- data/vagrantup-0.1.3.gem +0 -0
- data/vagrantup-0.1.4.gem +0 -0
- data/vagrantup-0.2.0.gem +0 -0
- data/vagrantup-0.3.0.gem +0 -0
- data/vagrantup-0.3.1.gem +0 -0
- data/vagrantup-0.3.2.gem +0 -0
- data/vagrantup-0.3.3.gem +0 -0
- data/vagrantup-0.3.4.gem +0 -0
- data/vagrantup-0.4.0.gem +0 -0
- data/vagrantup-0.4.1.gem +0 -0
- data/vagrantup-0.4.3.dev.gem +0 -0
- data/vagrantup-0.5.0.gem +0 -0
- data/vagrantup-0.5.1.gem +0 -0
- data/vagrantup-0.5.2.gem +0 -0
- data/vagrantup-0.5.3.gem +0 -0
- data/vagrantup-0.5.4.gem +0 -0
- data/vagrantup-0.6.0.gem +0 -0
- data/vagrantup-0.6.1.gem +0 -0
- data/vagrantup-0.6.2.gem +0 -0
- data/vagrantup-0.6.3.gem +0 -0
- data/vagrantup-0.6.4.gem +0 -0
- data/vagrantup-0.6.5.gem +0 -0
- data/vagrantup-0.6.6.gem +0 -0
- data/vagrantup-0.6.7.gem +0 -0
- data/vagrantup-0.6.8.gem +0 -0
- data/vagrantup-0.6.9.gem +0 -0
- data/vagrantup-0.7.0.gem +0 -0
- data/vagrantup-0.7.1.gem +0 -0
- data/vagrantup-0.7.2.gem +0 -0
- data/vagrantup-0.7.3.gem +0 -0
- data/vagrantup-0.7.4.gem +0 -0
- data/vagrantup-0.7.5.gem +0 -0
- data/vagrantup-0.7.6.gem +0 -0
- data/vagrantup-0.7.7.gem +0 -0
- data/vagrantup-0.7.8.gem +0 -0
- data/vagrantup-0.8.0.gem +0 -0
- data/vagrantup-0.8.1.gem +0 -0
- data/vagrantup-0.8.10.gem +0 -0
- data/vagrantup-0.8.2.gem +0 -0
- data/vagrantup-0.8.3.gem +0 -0
- data/vagrantup-0.8.4.gem +0 -0
- data/vagrantup-0.8.5.gem +0 -0
- data/vagrantup-0.8.6.gem +0 -0
- data/vagrantup-0.8.7.gem +0 -0
- data/vagrantup-0.8.8.gem +0 -0
- data/vagrantup-0.8.9.gem +0 -0
- data/vagrantup-0.9.0.gem +0 -0
- data/vagrantup-0.9.1.gem +0 -0
- data/vagrantup-0.9.2.gem +0 -0
- data/vagrantup-0.9.3.gem +0 -0
- data/vagrantup-0.9.4.gem +0 -0
- data/vagrantup-0.9.5.gem +0 -0
- data/vagrantup-0.9.6.gem +0 -0
- data/vagrantup-0.9.7.gem +0 -0
- data/vagrantup-0.9.99.1.gem +0 -0
- data/vagrantup-0.9.99.2.gem +0 -0
- data/vagrantup-1.0.0.gem +0 -0
- data/vagrantup-1.0.1.gem +0 -0
- data/vagrantup-1.0.2.gem +0 -0
- data/vagrantup-1.0.3.gem +0 -0
- data/vagrantup-1.0.4.gem +0 -0
- data/vagrantup-1.0.5.gem +0 -0
- data/vagrantup-1.0.6.gem +0 -0
- data/vagrantup-1.1.4.gem +0 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
require "log4r"
|
2
|
+
|
3
|
+
module Vagrant
|
4
|
+
module Action
|
5
|
+
module Builtin
|
6
|
+
# This middleware sets the hostname of the guest according to the
|
7
|
+
# "vm.hostname" configuration parameter if it is set. This middleware
|
8
|
+
# should be placed such that the after the @app.call, a booted machine
|
9
|
+
# is available (this generally means BEFORE the boot middleware).
|
10
|
+
class SetHostname
|
11
|
+
def initialize(app, env)
|
12
|
+
@app = app
|
13
|
+
end
|
14
|
+
|
15
|
+
def call(env)
|
16
|
+
@app.call(env)
|
17
|
+
|
18
|
+
hostname = env[:machine].config.vm.hostname
|
19
|
+
if !hostname.nil?
|
20
|
+
env[:ui].info I18n.t("vagrant.actions.vm.hostname.setting")
|
21
|
+
env[:machine].guest.change_host_name(hostname)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require "pathname"
|
2
|
+
|
3
|
+
require "vagrant/util/ssh"
|
4
|
+
|
5
|
+
module Vagrant
|
6
|
+
module Action
|
7
|
+
module Builtin
|
8
|
+
# This class will exec into a full fledged SSH console into the
|
9
|
+
# remote machine. This middleware assumes that the VM is running and
|
10
|
+
# ready for SSH, and uses the {Machine#ssh_info} method to retrieve
|
11
|
+
# SSH information necessary to connect.
|
12
|
+
#
|
13
|
+
# Note: If there are any middleware after `SSHExec`, they will **not**
|
14
|
+
# run, since exec replaces the currently running process.
|
15
|
+
class SSHExec
|
16
|
+
# For quick access to the `SSH` class.
|
17
|
+
include Vagrant::Util
|
18
|
+
|
19
|
+
def initialize(app, env)
|
20
|
+
@app = app
|
21
|
+
end
|
22
|
+
|
23
|
+
def call(env)
|
24
|
+
# Grab the SSH info from the machine
|
25
|
+
info = env[:machine].ssh_info
|
26
|
+
|
27
|
+
# If the result is nil, then the machine is telling us that it is
|
28
|
+
# not yet ready for SSH, so we raise this exception.
|
29
|
+
raise Errors::SSHNotReady if info.nil?
|
30
|
+
|
31
|
+
if info[:private_key_path]
|
32
|
+
# Check the SSH key permissions
|
33
|
+
SSH.check_key_permissions(Pathname.new(info[:private_key_path]))
|
34
|
+
end
|
35
|
+
|
36
|
+
# Exec!
|
37
|
+
SSH.exec(info, env[:ssh_opts])
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require "log4r"
|
2
|
+
|
3
|
+
module Vagrant
|
4
|
+
module Action
|
5
|
+
module Builtin
|
6
|
+
# This class will run a single command on the remote machine and will
|
7
|
+
# mirror the output to the UI. The resulting exit status of the command
|
8
|
+
# will exist in the `:ssh_run_exit_status` key in the environment.
|
9
|
+
class SSHRun
|
10
|
+
def initialize(app, env)
|
11
|
+
@app = app
|
12
|
+
@logger = Log4r::Logger.new("vagrant::action::builtin::ssh_run")
|
13
|
+
end
|
14
|
+
|
15
|
+
def call(env)
|
16
|
+
command = env[:ssh_run_command]
|
17
|
+
|
18
|
+
@logger.debug("Executing command: #{command}")
|
19
|
+
exit_status = 0
|
20
|
+
exit_status = env[:machine].communicate.execute(command, :error_check => false) do |type, data|
|
21
|
+
# Determine the proper channel to send the output onto depending
|
22
|
+
# on the type of data we are receiving.
|
23
|
+
channel = type == :stdout ? :out : :error
|
24
|
+
|
25
|
+
# Print the output as it comes in, but don't prefix it and don't
|
26
|
+
# force a new line so that the output is properly preserved however
|
27
|
+
# it may be formatted.
|
28
|
+
env[:ui].info(data.to_s,
|
29
|
+
:prefix => false,
|
30
|
+
:new_line => false,
|
31
|
+
:channel => channel)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Set the exit status on a known environmental variable
|
35
|
+
env[:ssh_run_exit_status] = exit_status
|
36
|
+
|
37
|
+
# Call the next middleware
|
38
|
+
@app.call(env)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'fileutils'
|
2
|
-
|
2
|
+
|
3
|
+
require 'vagrant/util/subprocess'
|
3
4
|
|
4
5
|
module Vagrant
|
5
6
|
module Action
|
@@ -63,9 +64,9 @@ module Vagrant
|
|
63
64
|
|
64
65
|
# Copy direcotry contents recursively.
|
65
66
|
if File.directory?(from)
|
66
|
-
FileUtils.cp_r(Dir.glob(from), to.parent)
|
67
|
+
FileUtils.cp_r(Dir.glob(from), to.parent, :preserve => true)
|
67
68
|
else
|
68
|
-
FileUtils.cp(from, to)
|
69
|
+
FileUtils.cp(from, to, :preserve => true)
|
69
70
|
end
|
70
71
|
end
|
71
72
|
end
|
@@ -73,21 +74,21 @@ module Vagrant
|
|
73
74
|
# Compress the exported file into a package
|
74
75
|
def compress
|
75
76
|
@env[:ui].info I18n.t("vagrant.actions.general.package.compressing", :tar_path => tar_path)
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
77
|
+
|
78
|
+
# Copy over the included files
|
79
|
+
copy_include_files
|
80
|
+
|
81
|
+
# Get the output path. We have to do this up here so that the
|
82
|
+
# pwd returns the proper thing.
|
83
|
+
output_path = tar_path.to_s
|
84
|
+
|
85
|
+
# Switch into that directory and package everything up
|
86
|
+
Dir.chdir(@env["package.directory"]) do
|
87
|
+
# Find all the files in our current directory and tar it up!
|
88
|
+
files = Dir.glob(File.join(".", "**", "*"))
|
89
|
+
|
90
|
+
# Package!
|
91
|
+
Util::Subprocess.execute("bsdtar", "-czf", output_path, *files)
|
91
92
|
end
|
92
93
|
end
|
93
94
|
|
@@ -0,0 +1,103 @@
|
|
1
|
+
module Vagrant
|
2
|
+
module Action
|
3
|
+
# This class manages hooks into existing {Builder} stacks, and lets you
|
4
|
+
# add and remove middleware classes. This is the primary method by which
|
5
|
+
# plugins can hook into built-in middleware stacks.
|
6
|
+
class Hook
|
7
|
+
# This is a hash of the middleware to prepend to a certain
|
8
|
+
# other middleware.
|
9
|
+
#
|
10
|
+
# @return [Hash<Class, Array<Class>>]
|
11
|
+
attr_reader :before_hooks
|
12
|
+
|
13
|
+
# This is a hash of the middleware to append to a certain other
|
14
|
+
# middleware.
|
15
|
+
#
|
16
|
+
# @return [Hash<Class, Array<Class>>]
|
17
|
+
attr_reader :after_hooks
|
18
|
+
|
19
|
+
# This is a list of the hooks to just prepend to the beginning
|
20
|
+
#
|
21
|
+
# @return [Array<Class>]
|
22
|
+
attr_reader :prepend_hooks
|
23
|
+
|
24
|
+
# This is a list of the hooks to just append to the end
|
25
|
+
#
|
26
|
+
# @return [Array<Class>]
|
27
|
+
attr_reader :append_hooks
|
28
|
+
|
29
|
+
def initialize
|
30
|
+
@before_hooks = Hash.new { |h, k| h[k] = [] }
|
31
|
+
@after_hooks = Hash.new { |h, k| h[k] = [] }
|
32
|
+
@prepend_hooks = []
|
33
|
+
@append_hooks = []
|
34
|
+
end
|
35
|
+
|
36
|
+
# Add a middleware before an existing middleware.
|
37
|
+
#
|
38
|
+
# @param [Class] existing The existing middleware.
|
39
|
+
# @param [Class] new The new middleware.
|
40
|
+
def before(existing, new, *args, &block)
|
41
|
+
@before_hooks[existing] << [new, args, block]
|
42
|
+
end
|
43
|
+
|
44
|
+
# Add a middleware after an existing middleware.
|
45
|
+
#
|
46
|
+
# @param [Class] existing The existing middleware.
|
47
|
+
# @param [Class] new The new middleware.
|
48
|
+
def after(existing, new, *args, &block)
|
49
|
+
@after_hooks[existing] << [new, args, block]
|
50
|
+
end
|
51
|
+
|
52
|
+
# Append a middleware to the end of the stack. Note that if the
|
53
|
+
# middleware sequence ends early, then the new middleware won't
|
54
|
+
# be run.
|
55
|
+
#
|
56
|
+
# @param [Class] new The middleware to append.
|
57
|
+
def append(new, *args, &block)
|
58
|
+
@append_hooks << [new, args, block]
|
59
|
+
end
|
60
|
+
|
61
|
+
# Prepend a middleware to the beginning of the stack.
|
62
|
+
#
|
63
|
+
# @param [Class] new The new middleware to prepend.
|
64
|
+
def prepend(new, *args, &block)
|
65
|
+
@prepend_hooks << [new, args, block]
|
66
|
+
end
|
67
|
+
|
68
|
+
# This applies the given hook to a builder. This should not be
|
69
|
+
# called directly.
|
70
|
+
#
|
71
|
+
# @param [Builder] builder
|
72
|
+
def apply(builder)
|
73
|
+
# Prepends first
|
74
|
+
@prepend_hooks.each do |klass, args, block|
|
75
|
+
builder.insert(0, klass, *args, &block)
|
76
|
+
end
|
77
|
+
|
78
|
+
# Appends
|
79
|
+
@append_hooks.each do |klass, args, block|
|
80
|
+
builder.use(klass, *args, &block)
|
81
|
+
end
|
82
|
+
|
83
|
+
# Before hooks
|
84
|
+
@before_hooks.each do |key, list|
|
85
|
+
next if !builder.index(key)
|
86
|
+
|
87
|
+
list.each do |klass, args, block|
|
88
|
+
builder.insert_before(key, klass, *args, &block)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# After hooks
|
93
|
+
@after_hooks.each do |key, list|
|
94
|
+
next if !builder.index(key)
|
95
|
+
|
96
|
+
list.each do |klass, args, block|
|
97
|
+
builder.insert_after(key, klass, *args, &block)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'log4r'
|
2
2
|
|
3
|
+
require 'vagrant/action/hook'
|
3
4
|
require 'vagrant/util/busy'
|
4
5
|
|
5
6
|
# TODO:
|
@@ -10,8 +11,7 @@ module Vagrant
|
|
10
11
|
class Runner
|
11
12
|
@@reported_interrupt = false
|
12
13
|
|
13
|
-
def initialize(
|
14
|
-
@registry = registry
|
14
|
+
def initialize(globals=nil, &block)
|
15
15
|
@globals = globals || {}
|
16
16
|
@lazy_globals = block
|
17
17
|
@logger = Log4r::Logger.new("vagrant::action::runner")
|
@@ -19,16 +19,28 @@ module Vagrant
|
|
19
19
|
|
20
20
|
def run(callable_id, options=nil)
|
21
21
|
callable = callable_id
|
22
|
-
callable = Builder.
|
23
|
-
callable = @registry.get(callable_id) if callable_id.kind_of?(Symbol)
|
22
|
+
callable = Builder.build(callable_id) if callable_id.kind_of?(Class)
|
24
23
|
raise ArgumentError, "Argument to run must be a callable object or registered action." if !callable || !callable.respond_to?(:call)
|
25
24
|
|
26
25
|
# Create the initial environment with the options given
|
27
|
-
environment =
|
26
|
+
environment = {}
|
28
27
|
environment.merge!(@globals)
|
29
28
|
environment.merge!(@lazy_globals.call) if @lazy_globals
|
30
29
|
environment.merge!(options || {})
|
31
30
|
|
31
|
+
# Setup the action hooks
|
32
|
+
hooks = Vagrant.plugin("2").manager.action_hooks(environment[:action_name])
|
33
|
+
if !hooks.empty?
|
34
|
+
@logger.info("Preparing hooks for middleware sequence...")
|
35
|
+
environment[:action_hooks] = hooks.map do |hook_proc|
|
36
|
+
Hook.new.tap do |h|
|
37
|
+
hook_proc.call(h)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
@logger.info("#{environment[:action_hooks].length} hooks defined.")
|
42
|
+
end
|
43
|
+
|
32
44
|
# Run the action chain in a busy block, marking the environment as
|
33
45
|
# interrupted if a SIGINT occurs, and exiting cleanly once the
|
34
46
|
# chain has been run.
|
@@ -47,6 +59,10 @@ module Vagrant
|
|
47
59
|
# We place a process lock around every action that is called
|
48
60
|
@logger.info("Running action: #{callable_id}")
|
49
61
|
Util::Busy.busy(int_callback) { callable.call(environment) }
|
62
|
+
|
63
|
+
# Return the environment in case there are things in there that
|
64
|
+
# the caller wants to use.
|
65
|
+
environment
|
50
66
|
end
|
51
67
|
end
|
52
68
|
end
|
@@ -16,9 +16,10 @@ module Vagrant
|
|
16
16
|
attr_accessor :actions, :stack
|
17
17
|
|
18
18
|
def initialize(actions, env)
|
19
|
-
@stack
|
20
|
-
@actions
|
21
|
-
@logger
|
19
|
+
@stack = []
|
20
|
+
@actions = actions.map { |m| finalize_action(m, env) }
|
21
|
+
@logger = Log4r::Logger.new("vagrant::action::warden")
|
22
|
+
@last_error = nil
|
22
23
|
end
|
23
24
|
|
24
25
|
def call(env)
|
@@ -37,20 +38,28 @@ module Vagrant
|
|
37
38
|
# we just exit immediately.
|
38
39
|
raise
|
39
40
|
rescue Exception => e
|
40
|
-
|
41
|
+
# We guard this so that the Warden only outputs this once for
|
42
|
+
# an exception that bubbles up.
|
43
|
+
if e != @last_error
|
44
|
+
@logger.error("Error occurred: #{e}")
|
45
|
+
@last_error = e
|
46
|
+
end
|
47
|
+
|
41
48
|
env["vagrant.error"] = e
|
42
49
|
|
43
50
|
# Something went horribly wrong. Start the rescue chain then
|
44
51
|
# reraise the exception to properly kick us out of limbo here.
|
45
|
-
|
52
|
+
recover(env)
|
46
53
|
raise
|
47
54
|
end
|
48
55
|
end
|
49
56
|
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
def
|
57
|
+
# We implement the recover method ourselves in case a Warden is
|
58
|
+
# embedded within another Warden. To recover, we just do our own
|
59
|
+
# recovery process on our stack.
|
60
|
+
def recover(env)
|
61
|
+
@logger.info("Beginning recovery process...")
|
62
|
+
|
54
63
|
@stack.each do |act|
|
55
64
|
if act.respond_to?(:recover)
|
56
65
|
@logger.info("Calling recover: #{act}")
|
@@ -58,6 +67,8 @@ module Vagrant
|
|
58
67
|
end
|
59
68
|
end
|
60
69
|
|
70
|
+
@logger.info("Recovery complete.")
|
71
|
+
|
61
72
|
# Clear stack so that warden down the middleware chain doesn't
|
62
73
|
# rescue again.
|
63
74
|
@stack.clear
|
data/lib/vagrant/box.rb
CHANGED
@@ -1,44 +1,93 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require "log4r"
|
5
|
+
|
6
|
+
require "vagrant/util/platform"
|
7
|
+
require "vagrant/util/subprocess"
|
8
|
+
|
1
9
|
module Vagrant
|
2
|
-
# Represents a "box," which is
|
3
|
-
#
|
4
|
-
# virtual machine, at the least. They are created with `vagrant package`
|
5
|
-
# and may contain additional files if specified by the creator. This
|
6
|
-
# class serves to help manage these boxes, although most of the logic
|
7
|
-
# is kicked out to middlewares.
|
10
|
+
# Represents a "box," which is a package Vagrant environment that is used
|
11
|
+
# as a base image when creating a new guest machine.
|
8
12
|
class Box
|
9
|
-
|
13
|
+
include Comparable
|
14
|
+
|
15
|
+
# The box name. This is the logical name used when adding the box.
|
16
|
+
#
|
17
|
+
# @return [String]
|
10
18
|
attr_reader :name
|
11
19
|
|
12
|
-
#
|
20
|
+
# This is the provider that this box is built for.
|
21
|
+
#
|
22
|
+
# @return [Symbol]
|
23
|
+
attr_reader :provider
|
24
|
+
|
25
|
+
# This is the directory on disk where this box exists.
|
26
|
+
#
|
27
|
+
# @return [Pathname]
|
13
28
|
attr_reader :directory
|
14
29
|
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
30
|
+
# This is the metadata for the box. This is read from the "metadata.json"
|
31
|
+
# file that all boxes require.
|
32
|
+
#
|
33
|
+
# @return [Hash]
|
34
|
+
attr_reader :metadata
|
35
|
+
|
36
|
+
# This is used to initialize a box.
|
18
37
|
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
@
|
38
|
+
# @param [String] name Logical name of the box.
|
39
|
+
# @param [Symbol] provider The provider that this box implements.
|
40
|
+
# @param [Pathname] directory The directory where this box exists on
|
41
|
+
# disk.
|
42
|
+
def initialize(name, provider, directory)
|
43
|
+
@name = name
|
44
|
+
@provider = provider
|
45
|
+
@directory = directory
|
46
|
+
@metadata = JSON.parse(directory.join("metadata.json").read)
|
47
|
+
|
48
|
+
@logger = Log4r::Logger.new("vagrant::box")
|
25
49
|
end
|
26
50
|
|
27
|
-
#
|
28
|
-
def destroy
|
29
|
-
|
51
|
+
# This deletes the box. This is NOT undoable.
|
52
|
+
def destroy!
|
53
|
+
# Delete the directory to delete the box.
|
54
|
+
FileUtils.rm_r(@directory)
|
55
|
+
|
56
|
+
# Just return true always
|
57
|
+
true
|
58
|
+
rescue Errno::ENOENT
|
59
|
+
# This means the directory didn't exist. Not a problem.
|
60
|
+
return true
|
30
61
|
end
|
31
62
|
|
32
|
-
#
|
33
|
-
|
34
|
-
|
63
|
+
# This repackages this box and outputs it to the given path.
|
64
|
+
#
|
65
|
+
# @param [Pathname] path The full path (filename included) of where
|
66
|
+
# to output this box.
|
67
|
+
# @return [Boolean] true if this succeeds.
|
68
|
+
def repackage(path)
|
69
|
+
@logger.debug("Repackaging box '#{@name}' to: #{path}")
|
70
|
+
|
71
|
+
Dir.chdir(@directory) do
|
72
|
+
# Find all the files in our current directory and tar it up!
|
73
|
+
files = Dir.glob(File.join(".", "**", "*"))
|
74
|
+
|
75
|
+
# Package!
|
76
|
+
Util::Subprocess.execute("bsdtar", "-czf", path.to_s, *files)
|
77
|
+
end
|
78
|
+
|
79
|
+
@logger.info("Repackaged box '#{@name}' successfully: #{path}")
|
80
|
+
|
81
|
+
true
|
35
82
|
end
|
36
83
|
|
37
|
-
# Implemented for comparison with other boxes. Comparison is
|
38
|
-
# by
|
84
|
+
# Implemented for comparison with other boxes. Comparison is
|
85
|
+
# implemented by comparing names and providers.
|
39
86
|
def <=>(other)
|
40
87
|
return super if !other.is_a?(self.class)
|
41
|
-
|
88
|
+
|
89
|
+
# Comparison is done by composing the name and provider
|
90
|
+
"#{@name}-#{@provider}" <=> "#{other.name}-#{other.provider}"
|
42
91
|
end
|
43
92
|
end
|
44
93
|
end
|