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,35 +0,0 @@
|
|
1
|
-
module Vagrant
|
2
|
-
module Util
|
3
|
-
# Represents the "stacked proc runner" behavior which is used a
|
4
|
-
# couple places within Vagrant. This allows procs to "stack" on
|
5
|
-
# each other, then all execute in a single action. An example of
|
6
|
-
# its uses can be seen in the {Config} class.
|
7
|
-
module StackedProcRunner
|
8
|
-
# Returns the proc stack. This should always be called as the
|
9
|
-
# accessor of the stack. The instance variable itself should _never_
|
10
|
-
# be used.
|
11
|
-
#
|
12
|
-
# @return [Array<Proc>]
|
13
|
-
def proc_stack
|
14
|
-
@_proc_stack ||= []
|
15
|
-
end
|
16
|
-
|
17
|
-
# Adds (pushes) a proc to the stack. The actual proc added here is
|
18
|
-
# not executed, but merely stored.
|
19
|
-
#
|
20
|
-
# @param [Proc] block
|
21
|
-
def push_proc(&block)
|
22
|
-
proc_stack << block
|
23
|
-
end
|
24
|
-
|
25
|
-
# Executes all the procs on the stack, passing in the given arguments.
|
26
|
-
# The stack is not cleared afterwords. It is up to the user of this
|
27
|
-
# mixin to clear the stack by calling `proc_stack.clear`.
|
28
|
-
def run_procs!(*args)
|
29
|
-
proc_stack.each do |proc|
|
30
|
-
proc.call(*args)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,75 +0,0 @@
|
|
1
|
-
module Vagrant
|
2
|
-
module Util
|
3
|
-
# This class modifies strings by creating and managing Vagrant-owned
|
4
|
-
# "blocks" via wrapping them in specially formed comments.
|
5
|
-
#
|
6
|
-
# This is useful when modifying a file that someone else owns and adding
|
7
|
-
# automatic entries into it. Example: /etc/exports or some other
|
8
|
-
# configuration file.
|
9
|
-
#
|
10
|
-
# Vagrant marks ownership of a block in the string by wrapping it in
|
11
|
-
# VAGRANT-BEGIN and VAGRANT-END comments with a unique ID. Example:
|
12
|
-
#
|
13
|
-
# foo
|
14
|
-
# # VAGRANT-BEGIN: id
|
15
|
-
# some contents
|
16
|
-
# created by vagrant
|
17
|
-
# # VAGRANT-END: id
|
18
|
-
#
|
19
|
-
# The goal of this class is to be able to insert and remove these
|
20
|
-
# blocks without modifying anything else in the string.
|
21
|
-
#
|
22
|
-
# The strings usually come from files but it is up to the caller to
|
23
|
-
# manage the file resource.
|
24
|
-
class StringBlockEditor
|
25
|
-
# The current string value. This is the value that is modified by
|
26
|
-
# the methods below.
|
27
|
-
#
|
28
|
-
# @return [String]
|
29
|
-
attr_reader :value
|
30
|
-
|
31
|
-
def initialize(string)
|
32
|
-
@value = string
|
33
|
-
end
|
34
|
-
|
35
|
-
# This returns the keys (or ids) that are in the string.
|
36
|
-
#
|
37
|
-
# @return [<Array<String>]
|
38
|
-
def keys
|
39
|
-
regexp = /^#\s*VAGRANT-BEGIN:\s*(.+?)$\r?\n?(.*)$\r?\n?^#\s*VAGRANT-END:\s(\1)$/m
|
40
|
-
@value.scan(regexp).map do |match|
|
41
|
-
match[0]
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
# This deletes the block with the given key if it exists.
|
46
|
-
def delete(key)
|
47
|
-
regexp = /^#\s*VAGRANT-BEGIN:\s*#{key}$.*^#\s*VAGRANT-END:\s*#{key}$\r?\n?/m
|
48
|
-
@value.gsub!(regexp, "")
|
49
|
-
end
|
50
|
-
|
51
|
-
# This gets the value of the block with the given key.
|
52
|
-
def get(key)
|
53
|
-
regexp = /^#\s*VAGRANT-BEGIN:\s*#{key}$\r?\n?(.*?)\r?\n?^#\s*VAGRANT-END:\s*#{key}$\r?\n?/m
|
54
|
-
match = regexp.match(@value)
|
55
|
-
return nil if !match
|
56
|
-
match[1]
|
57
|
-
end
|
58
|
-
|
59
|
-
# This inserts a block with the given key and value.
|
60
|
-
#
|
61
|
-
# @param [String] key
|
62
|
-
# @param [String] value
|
63
|
-
def insert(key, value)
|
64
|
-
# Insert the new block into the value
|
65
|
-
new_block = <<BLOCK
|
66
|
-
# VAGRANT-BEGIN: #{key}
|
67
|
-
#{value.strip}
|
68
|
-
# VAGRANT-END: #{key}
|
69
|
-
BLOCK
|
70
|
-
|
71
|
-
@value << new_block
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
@@ -1,270 +0,0 @@
|
|
1
|
-
require 'childprocess'
|
2
|
-
require 'log4r'
|
3
|
-
|
4
|
-
require 'vagrant/util/platform'
|
5
|
-
|
6
|
-
module Vagrant
|
7
|
-
module Util
|
8
|
-
# Execute a command in a subprocess, gathering the results and
|
9
|
-
# exit status.
|
10
|
-
#
|
11
|
-
# This class also allows you to read the data as it is outputted
|
12
|
-
# from the subprocess in real time, by simply passing a block to
|
13
|
-
# the execute method.
|
14
|
-
class Subprocess
|
15
|
-
# The chunk size for reading from subprocess IO.
|
16
|
-
READ_CHUNK_SIZE = 4096
|
17
|
-
|
18
|
-
# Convenience method for executing a method.
|
19
|
-
def self.execute(*command, &block)
|
20
|
-
new(*command).execute(&block)
|
21
|
-
end
|
22
|
-
|
23
|
-
def initialize(*command)
|
24
|
-
@options = command.last.is_a?(Hash) ? command.pop : {}
|
25
|
-
@command = command
|
26
|
-
@logger = Log4r::Logger.new("vagrant::util::subprocess")
|
27
|
-
end
|
28
|
-
|
29
|
-
def execute
|
30
|
-
# Get the timeout, if we have one
|
31
|
-
timeout = @options[:timeout]
|
32
|
-
|
33
|
-
# Get the working directory
|
34
|
-
workdir = @options[:workdir] || Dir.pwd
|
35
|
-
|
36
|
-
# Get what we're interested in being notified about
|
37
|
-
notify = @options[:notify] || []
|
38
|
-
notify = [notify] if !notify.is_a?(Array)
|
39
|
-
if notify.empty? && block_given?
|
40
|
-
# If a block is given, subscribers must be given, otherwise the
|
41
|
-
# block is never called. This is usually NOT what you want, so this
|
42
|
-
# is an error.
|
43
|
-
message = "A list of notify subscriptions must be given if a block is given"
|
44
|
-
raise ArgumentError, message
|
45
|
-
end
|
46
|
-
|
47
|
-
# Let's get some more useful booleans that we access a lot so
|
48
|
-
# we're not constantly calling an `include` check
|
49
|
-
notify_table = {}
|
50
|
-
notify_table[:stderr] = notify.include?(:stderr)
|
51
|
-
notify_table[:stdout] = notify.include?(:stdout)
|
52
|
-
notify_stdin = notify.include?(:stdin)
|
53
|
-
|
54
|
-
# Build the ChildProcess
|
55
|
-
@logger.info("Starting process: #{@command.inspect}")
|
56
|
-
process = ChildProcess.build(*@command)
|
57
|
-
|
58
|
-
# Create the pipes so we can read the output in real time as
|
59
|
-
# we execute the command.
|
60
|
-
stdout, stdout_writer = IO.pipe
|
61
|
-
stderr, stderr_writer = IO.pipe
|
62
|
-
process.io.stdout = stdout_writer
|
63
|
-
process.io.stderr = stderr_writer
|
64
|
-
process.duplex = true
|
65
|
-
|
66
|
-
# Set the environment on the process if we must
|
67
|
-
if @options[:env]
|
68
|
-
@options[:env].each do |k, v|
|
69
|
-
process.environment[k] = v
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
# Start the process
|
74
|
-
begin
|
75
|
-
Dir.chdir(workdir) do
|
76
|
-
process.start
|
77
|
-
end
|
78
|
-
rescue ChildProcess::LaunchError => ex
|
79
|
-
# Raise our own version of the error so that users of the class
|
80
|
-
# don't need to be aware of ChildProcess
|
81
|
-
raise LaunchError.new(ex.message)
|
82
|
-
end
|
83
|
-
|
84
|
-
# Make sure the stdin does not buffer
|
85
|
-
process.io.stdin.sync = true
|
86
|
-
|
87
|
-
if RUBY_PLATFORM != "java"
|
88
|
-
# On Java, we have to close after. See down the method...
|
89
|
-
# Otherwise, we close the writers right here, since we're
|
90
|
-
# not on the writing side.
|
91
|
-
stdout_writer.close
|
92
|
-
stderr_writer.close
|
93
|
-
end
|
94
|
-
|
95
|
-
# Create a dictionary to store all the output we see.
|
96
|
-
io_data = { :stdout => "", :stderr => "" }
|
97
|
-
|
98
|
-
# Record the start time for timeout purposes
|
99
|
-
start_time = Time.now.to_i
|
100
|
-
|
101
|
-
@logger.debug("Selecting on IO")
|
102
|
-
while true
|
103
|
-
writers = notify_stdin ? [process.io.stdin] : []
|
104
|
-
results = IO.select([stdout, stderr], writers, nil, timeout || 0.1)
|
105
|
-
results ||= []
|
106
|
-
readers = results[0]
|
107
|
-
writers = results[1]
|
108
|
-
|
109
|
-
# Check if we have exceeded our timeout
|
110
|
-
raise TimeoutExceeded, process.pid if timeout && (Time.now.to_i - start_time) > timeout
|
111
|
-
|
112
|
-
# Check the readers to see if they're ready
|
113
|
-
if readers && !readers.empty?
|
114
|
-
readers.each do |r|
|
115
|
-
# Read from the IO object
|
116
|
-
data = read_io(r)
|
117
|
-
|
118
|
-
# We don't need to do anything if the data is empty
|
119
|
-
next if data.empty?
|
120
|
-
|
121
|
-
io_name = r == stdout ? :stdout : :stderr
|
122
|
-
@logger.debug("#{io_name}: #{data.chomp}")
|
123
|
-
|
124
|
-
io_data[io_name] += data
|
125
|
-
yield io_name, data if block_given? && notify_table[io_name]
|
126
|
-
end
|
127
|
-
end
|
128
|
-
|
129
|
-
# Break out if the process exited. We have to do this before
|
130
|
-
# attempting to write to stdin otherwise we'll get a broken pipe
|
131
|
-
# error.
|
132
|
-
break if process.exited?
|
133
|
-
|
134
|
-
# Check the writers to see if they're ready, and notify any listeners
|
135
|
-
if writers && !writers.empty?
|
136
|
-
yield :stdin, process.io.stdin if block_given?
|
137
|
-
end
|
138
|
-
end
|
139
|
-
|
140
|
-
# Wait for the process to end.
|
141
|
-
begin
|
142
|
-
remaining = (timeout || 32000) - (Time.now.to_i - start_time)
|
143
|
-
remaining = 0 if remaining < 0
|
144
|
-
@logger.debug("Waiting for process to exit. Remaining to timeout: #{remaining}")
|
145
|
-
|
146
|
-
process.poll_for_exit(remaining)
|
147
|
-
rescue ChildProcess::TimeoutError
|
148
|
-
raise TimeoutExceeded, process.pid
|
149
|
-
end
|
150
|
-
|
151
|
-
@logger.debug("Exit status: #{process.exit_code}")
|
152
|
-
|
153
|
-
# Read the final output data, since it is possible we missed a small
|
154
|
-
# amount of text between the time we last read data and when the
|
155
|
-
# process exited.
|
156
|
-
[stdout, stderr].each do |io|
|
157
|
-
# Read the extra data, ignoring if there isn't any
|
158
|
-
extra_data = read_io(io)
|
159
|
-
next if extra_data == ""
|
160
|
-
|
161
|
-
# Log it out and accumulate
|
162
|
-
io_name = io == stdout ? :stdout : :stderr
|
163
|
-
io_data[io_name] += extra_data
|
164
|
-
@logger.debug("#{io_name}: #{extra_data.chomp}")
|
165
|
-
|
166
|
-
# Yield to any listeners any remaining data
|
167
|
-
yield io_name, extra_data if block_given?
|
168
|
-
end
|
169
|
-
|
170
|
-
if RUBY_PLATFORM == "java"
|
171
|
-
# On JRuby, we need to close the writers after the process,
|
172
|
-
# for some reason. See GH-711.
|
173
|
-
stdout_writer.close
|
174
|
-
stderr_writer.close
|
175
|
-
end
|
176
|
-
|
177
|
-
# Return an exit status container
|
178
|
-
return Result.new(process.exit_code, io_data[:stdout], io_data[:stderr])
|
179
|
-
end
|
180
|
-
|
181
|
-
protected
|
182
|
-
|
183
|
-
# Reads data from an IO object while it can, returning the data it reads.
|
184
|
-
# When it encounters a case when it can't read anymore, it returns the
|
185
|
-
# data.
|
186
|
-
#
|
187
|
-
# @return [String]
|
188
|
-
def read_io(io)
|
189
|
-
data = ""
|
190
|
-
|
191
|
-
while true
|
192
|
-
begin
|
193
|
-
if Platform.windows?
|
194
|
-
# Windows doesn't support non-blocking reads on
|
195
|
-
# file descriptors or pipes so we have to get
|
196
|
-
# a bit more creative.
|
197
|
-
|
198
|
-
# Check if data is actually ready on this IO device.
|
199
|
-
# We have to do this since `readpartial` will actually block
|
200
|
-
# until data is available, which can cause blocking forever
|
201
|
-
# in some cases.
|
202
|
-
results = IO.select([io], nil, nil, 0.1)
|
203
|
-
break if !results || results[0].empty?
|
204
|
-
|
205
|
-
# Read!
|
206
|
-
data << io.readpartial(READ_CHUNK_SIZE)
|
207
|
-
else
|
208
|
-
# Do a simple non-blocking read on the IO object
|
209
|
-
data << io.read_nonblock(READ_CHUNK_SIZE)
|
210
|
-
end
|
211
|
-
rescue Exception => e
|
212
|
-
# The catch-all rescue here is to support multiple Ruby versions,
|
213
|
-
# since we use some Ruby 1.9 specific exceptions.
|
214
|
-
|
215
|
-
breakable = false
|
216
|
-
if e.is_a?(EOFError)
|
217
|
-
# An `EOFError` means this IO object is done!
|
218
|
-
breakable = true
|
219
|
-
elsif defined?(IO::WaitReadable) && e.is_a?(IO::WaitReadable)
|
220
|
-
# IO::WaitReadable is only available on Ruby 1.9+
|
221
|
-
|
222
|
-
# An IO::WaitReadable means there may be more IO but this
|
223
|
-
# IO object is not ready to be read from yet. No problem,
|
224
|
-
# we read as much as we can, so we break.
|
225
|
-
breakable = true
|
226
|
-
elsif e.is_a?(Errno::EAGAIN)
|
227
|
-
# Otherwise, we just look for the EAGAIN error which should be
|
228
|
-
# all that IO::WaitReadable does in Ruby 1.9.
|
229
|
-
breakable = true
|
230
|
-
end
|
231
|
-
|
232
|
-
# Break out if we're supposed to. Otherwise re-raise the error
|
233
|
-
# because it is a real problem.
|
234
|
-
break if breakable
|
235
|
-
raise
|
236
|
-
end
|
237
|
-
end
|
238
|
-
|
239
|
-
data
|
240
|
-
end
|
241
|
-
|
242
|
-
# An error which raises when a process fails to start
|
243
|
-
class LaunchError < StandardError; end
|
244
|
-
|
245
|
-
# An error which occurs when the process doesn't end within
|
246
|
-
# the given timeout.
|
247
|
-
class TimeoutExceeded < StandardError
|
248
|
-
attr_reader :pid
|
249
|
-
|
250
|
-
def initialize(pid)
|
251
|
-
super()
|
252
|
-
@pid = pid
|
253
|
-
end
|
254
|
-
end
|
255
|
-
|
256
|
-
# Container class to store the results of executing a subprocess.
|
257
|
-
class Result
|
258
|
-
attr_reader :exit_code
|
259
|
-
attr_reader :stdout
|
260
|
-
attr_reader :stderr
|
261
|
-
|
262
|
-
def initialize(exit_code, stdout, stderr)
|
263
|
-
@exit_code = exit_code
|
264
|
-
@stdout = stdout
|
265
|
-
@stderr = stderr
|
266
|
-
end
|
267
|
-
end
|
268
|
-
end
|
269
|
-
end
|
270
|
-
end
|
@@ -1,83 +0,0 @@
|
|
1
|
-
require 'ostruct'
|
2
|
-
require 'erubis'
|
3
|
-
|
4
|
-
module Vagrant
|
5
|
-
module Util
|
6
|
-
# This class is used to render the ERB templates in the
|
7
|
-
# `GEM_ROOT/templates` directory.
|
8
|
-
class TemplateRenderer < OpenStruct
|
9
|
-
class << self
|
10
|
-
# Render a given template and return the result. This method optionally
|
11
|
-
# takes a block which will be passed the renderer prior to rendering, which
|
12
|
-
# allows the caller to set any view variables within the renderer itself.
|
13
|
-
#
|
14
|
-
# @return [String] Rendered template
|
15
|
-
def render(*args)
|
16
|
-
render_with(:render, *args)
|
17
|
-
end
|
18
|
-
|
19
|
-
# Render a given string and return the result. This method optionally
|
20
|
-
# takes a block which will be passed the renderer prior to rendering, which
|
21
|
-
# allows the caller to set any view variables within the renderer itself.
|
22
|
-
#
|
23
|
-
# @param [String] template The template data string.
|
24
|
-
# @return [String] Rendered template
|
25
|
-
def render_string(*args)
|
26
|
-
render_with(:render_string, *args)
|
27
|
-
end
|
28
|
-
|
29
|
-
# Method used internally to DRY out the other renderers. This method
|
30
|
-
# creates and sets up the renderer before calling a specified method on it.
|
31
|
-
def render_with(method, template, data={})
|
32
|
-
renderer = new(template, data)
|
33
|
-
yield renderer if block_given?
|
34
|
-
renderer.send(method.to_sym)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def initialize(template, data = {})
|
39
|
-
super()
|
40
|
-
|
41
|
-
data[:template] = template
|
42
|
-
data.each do |key, value|
|
43
|
-
send("#{key}=", value)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
# Renders the template using the class intance as the binding. Because the
|
48
|
-
# renderer inherits from `OpenStruct`, additional view variables can be
|
49
|
-
# added like normal accessors.
|
50
|
-
#
|
51
|
-
# @return [String]
|
52
|
-
def render
|
53
|
-
# TODO: Seems like a pretty dirty way to do this. Perhaps refactor this
|
54
|
-
old_template = template
|
55
|
-
result = nil
|
56
|
-
File.open(full_template_path, 'r') do |f|
|
57
|
-
self.template = f.read
|
58
|
-
result = render_string
|
59
|
-
end
|
60
|
-
|
61
|
-
result
|
62
|
-
ensure
|
63
|
-
self.template = old_template
|
64
|
-
end
|
65
|
-
|
66
|
-
# Renders a template, handling the template as a string, but otherwise
|
67
|
-
# acting the same way as {#render}.
|
68
|
-
#
|
69
|
-
# @return [String]
|
70
|
-
def render_string
|
71
|
-
Erubis::Eruby.new(template, :trim => true).result(binding)
|
72
|
-
end
|
73
|
-
|
74
|
-
# Returns the full path to the template, taking into accoun the gem directory
|
75
|
-
# and adding the `.erb` extension to the end.
|
76
|
-
#
|
77
|
-
# @return [String]
|
78
|
-
def full_template_path
|
79
|
-
Vagrant.source_root.join('templates', "#{template}.erb").to_s.squeeze("/")
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|